I dont see you calling the Accept method anywhere.
Here, I've cleaned the code up for you a bit. Not added anything.
VB.NET Code:
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 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 ep As New IPEndPoint(System.Net.IPAddress.Parse("127.0.0.1"), port) listenSocket.Bind(ep) ' start listening listenSocket.Listen(backlog) 'CreateAndListen End Sub




Reply With Quote