I have a simple tcp server listening for clients. I use a mud client to test if it's working. The mud client says that it's connected to 127.0.0.1, but the server doesn't show the msgbox that a client has connected. Any suggestions?
Code:Imports System.Net Imports System.Net.Sockets Imports System.IO Imports System.Threading Public Class Form1 Dim Host As New TcpListener(IPAddress.Any, 45050) Dim Client As New TcpClient Dim ConnectionSocket As Socket Dim ConnectionThread As New Thread(AddressOf ClientConnection) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Host.Start() ConnectionThread = New Thread(AddressOf ClientConnection) End Sub Private Sub ClientConnection() If Host.Pending = True Then Client = Host.AcceptTcpClient ConnectionSocket = Host.AcceptSocket MsgBox("Client is connected") End If End Sub End Class




Reply With Quote
