socket: Added socket_type enum to distinguish between UDP and TCP sockets.
        A boolean flag creates unreadable code.