libs/neuronet: Implemented UDP protocol support.
It is now possible to change which protocol the connections (client and
server) uses. We used to support only TCP connections but this change
also adds UDP. The new public interface function NNet_SetProtocolType
is to be used to set which protocol to use.
UDP is a connectionless protocol and as such, it also does not support
full duplex for server sockets. Suprisingly, UDP needs an open port
on the server and the client to function correctly. It does not appear
so for the programmer because this was made transparently. It does
not appear to administrators neither because the firewalls are made
to let pass unprivileged ports without any problem.
The best way I could implement UDP was to maintain a state for client
connections on a server instance. This state is searched for every
packets recieved to find the corresponding Slave struct and it then
does almost exactly the same steps as for TCP.