C# TcpListener connection problem
Ive had some problems getting the TcpListener under C# to find and accept connections from a client with my client app and/or a simple telnet connection. Connecting locally (localhost / 127.0.0.1) works fine but externally does not. First i thought that it must be a firewall that was refusing the connections, but even with it shut off (on both the server and client) i still cant get it to connect. Has anyone had the same problem and if so, what should i do to fix it? Im using WinXP Pro, .NET 1.1 and VS 2003. Heres a simplified version of how i setup the tcp listener on the server: // Initialize the tcp listener for connection clients TcpListener tcpServerListener = new TcpListener(IPAddress.Any, 8002); // Start the tcp listener tcpServerListener.Start(); // Wait for an incomming connection from a client Socket socket = tcpServerListener.AcceptSocket(); // Handle the connected client here
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement