Why won't the following code work in C#?
var c1 = new TcpClient(new IPEndPoint(IPAddress.Any, 8787));
var c2 = new TcpClient(new IPEndPoint(IPAddress.Any, 8788));
c1.Connect("localhost", 8788);
I get a "connection cannot be made because the target machine actively refused it". So, the TcpClient constructor doesn't appear to be binding the port, but I tried the Socket.Bind() function with no luck either.