Server is not active?

ollie ollie at home.net
Fri Sep 27 22:28:05 PDT 2013


On Fri, 27 Sep 2013 03:22:32 +0200, wagtail wrote:

> A part of code shown below.
> 
> /++++++++++++++++++++++++++ Server main()
> ++++++++++++++++++++++++++++++++/
>          ushort port = 9876;
> 
> 	auto inet = new InternetAddress("0.0.0.0",port);
> 	Socket server = new TcpSocket(inet.addressFamily());
> 
> 	bool flag = true;
> 
> 	server.bind(inet);
> 	server.listen(255);

Is there any particular reason to use "0.0.0.0" creating your 
InternetAddress?  I think it should be the ip of your server
or just send port and ADDR_ANY will be used.

>From Wikipedia:

In the Internet Protocol version 4 the address 0.0.0.0 is a non-routable 
meta-address used to designate an invalid, unknown or non applicable 
target.


More information about the Digitalmars-d-learn mailing list