Page 1 of 1
[Implemented] Network serveur listening on local IP only ...
Posted: Tue Jun 23, 2009 1:40 pm
by Niffo
When initialising a network server (CreateNetworkServer()), it would be a great thing to be able to specify the IP address to listen like we can do with WinSocks
Code: Select all
sin\sin_addr = inet_addr_("127.0.0.1")
sin\sin_addr = #INADDR_ANY
One of the advantages is that the Windows Firewall does not triggers when listening on local IP.
Posted: Tue Jun 23, 2009 4:19 pm
by Tranquil
Something similar has been requested some months before.
It would be nice to define the IP numbers for the created network server. It would also be nice to accept the connection from within our code and not automaticaly as it is done now.
There are many improvements required on the network lib to use it for commercial applications. (for example: an option for disable the receive of files on a server socket)
Re: Network serveur listening on local IP only ...
Posted: Wed May 05, 2010 7:55 am
by infratec
Hi,
since I wrote yesterday a small server program and it was not working as expected,
I fully argree with you.
I had forgotten, that I have a second network card in my PC.
And, shit happens, my program used this IP number to connect the server to it.
Result: half an hour of searching a fault, why the client does not connect to the server.
Best regards,
Bernd
Re:
Posted: Tue Jul 13, 2010 9:49 pm
by helpy
Tranquil wrote:There are many improvements required on the network lib to use it for commercial applications. (for example: an option for disable the receive of files on a server socket)
It is possible to use ReceiveNetworkData() (instead of ReceiveNetworkFile()) to receive files, which are sent with SendNetworkFile().
SendNetworkFile() sends a file like this:
Code: Select all
First 8 Bytes: PBMGSFLE
Than a long: [Size of File]
Than the file data: [Bytes]
If the client is not allowed to send files to the server, the server could close the connection to the client. As soon as you get an #PB_NetworkEvent_FIle you can CloseNetworkConnection(EventClient()), because the client does not keep the "server rules".
What are you doing if a "bad client" is sending a lot of chunk data?
cu,
helpy
Re: Network serveur listening on local IP only ...
Posted: Wed Aug 04, 2010 8:46 am
by Tranquil
Thats a good hint! Atm I just use ReceiveNetworkData() which gets first some information on the datas that will received (size of package etc) and after that a validation has been done. If validation is false the connection will be closed.