.net - How to listen to specific IP address -
on server, under advanced tcp/ip settings have 2 ip addresses added. question is, how can specify want listen first or second ip? there way obtain ip addresses on machine via .net , select 1 listen to?
any appreciated. hope question clear.
thanks.
the tcplistener
in system.net.sockets
accepts ip , port on construction:
int32 port = 13000; ipaddress localaddr = ipaddress.parse("127.0.0.1"); // tcplistener server = new tcplistener(port); server = new tcplistener(localaddr, port);
Comments
Post a Comment