Using socket to send messages through UDP