sockets were tested only in TCP mode. main.c now contains some test cases for socket code.
by the `mergedirs' script. Few more IP address manipulation functions and some fixes.