Fix datagram socket switching on

Fixed UDP datagram socket being switched on (doesn't repeatedly open new sockets).