An additional optional parameter for the EventClient() function would make it possible to do real multi threaded networking. For now the only way I found to make it work (relatively unstable) is by using a shared thread for all the network operation or using that thread to dispatch network messages to worker threads; and I use a lot of Lock/Unlock each time when checking for events.
Code: Select all
EventClient([Server])
Also useful to avoid "unnecessary" wrapping or for ease of use would be:
Code: Select all
ClientIPVersion(Client) ; returns 4 or 6 or 0 (on error)
ServerIPVersion(Server) ;"
Code: Select all
ClientFlags(Client) ; returns the flags in #PB_Network_* constants format = IP Version + Used Protocol + X
ServerFlags(Server) ; "
Code: Select all
ServerBindedIP(Server) ; returns the indicated string
ServerPort(Server) ; the port you opened the server on
Dear Santa, it would be fancy to set the socket options without going through the API. (all those TCP/UDP/timeout socket options)
Finally I have the impression that in old PB versions it was possible to do an UDP broadcast on LAN (255.255.255.255) but now it will fail to open an UDP socket with that broadcast address. Those types of broadcasts can be useful for searching LAN games or things like DHCP servers to get retrieve information like subnet mask or http proxy and more. Those addresses are reserved and not transmitted via routers except when explicitly configured for it to be a bridge, and normally backbone internet routers shouldn't relay or respond to these except when tunneled outside their knowledge like in a VPN (in which case they don't know about the content).