D
Darwin
Setting a server to listen on 8080 for incoming connections. Written in
VS2005 on a Multi-homed machine.
I get the warning:
Warning 1 'System.Net.Sockets.TcpListener.TcpListener(int)' is obsolete:
'This method has been deprecated. Please use TcpListener(IPAddress
localaddr, int port) instead.
on the code:
TcpListener tcpListener = new TcpListener(8080);
Do I really have to specify every IP address that I want to listen on?
The program compiled by changing the code to:
Int32 port = 8080;
IPAddress localAddr = IPAddress.Parse("127.0.0.1");
TcpListener tcpListener = new TcpListener(localAddr, port);
But does it mean that I am only listening on 127.0.0.1:8080? Why do I have
to specify an IP address I thought that specifying a port automatically
meant that you would be listening on that port for all IP addresses?
Just want to understand why
VS2005 on a Multi-homed machine.
I get the warning:
Warning 1 'System.Net.Sockets.TcpListener.TcpListener(int)' is obsolete:
'This method has been deprecated. Please use TcpListener(IPAddress
localaddr, int port) instead.
on the code:
TcpListener tcpListener = new TcpListener(8080);
Do I really have to specify every IP address that I want to listen on?
The program compiled by changing the code to:
Int32 port = 8080;
IPAddress localAddr = IPAddress.Parse("127.0.0.1");
TcpListener tcpListener = new TcpListener(localAddr, port);
But does it mean that I am only listening on 127.0.0.1:8080? Why do I have
to specify an IP address I thought that specifying a port automatically
meant that you would be listening on that port for all IP addresses?
Just want to understand why