|
-
Apr 8th, 2008, 02:46 PM
#11
Thread Starter
Hyperactive Member
Re: [2008] winsock and feasibility
Localhost variable hostip already declared in current block
Imports System.Net.Sockets
Imports System.Net
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim instance As Socket
Dim backlog As Integer
Dim hostip As String
Dim port As Integer
port = "80"
' create the socket
Dim listenSocket As New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
' bind the listening socket to the port
Dim hostIP As IPAddress = Dns.Resolve(IPAddress.Any.ToString()).AddressList(0)
Dim ep As New IPEndPoint(hostIP, port)
listenSocket.Bind(ep)
' start listening
listenSocket.Listen(backlog)
'CreateAndListen
End Sub
End Class
not sure now...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|