Is there anything special about the data that you want to send to a server?
What do you expect the server to do with the data it receives?
Do you know how to use Datagrams to send data to a server? Have you tried that?
Perhaps something like this could be used: