As simple example have a look at http://java.sun.com/docs/books/tutorial/networking/datagrams/examples/QuoteServerThread.java
Here is an extract of the code.
public void run() {
...
Type: Posts; User: Json
As simple example have a look at http://java.sun.com/docs/books/tutorial/networking/datagrams/examples/QuoteServerThread.java
Here is an extract of the code.
public void run() {
...
Have a look at Writing a Datagram Client and Server (The Java™ Tutorials > Custom Networking > All About Datagrams)
// Json
Why not use TCP instead then?
Have a look at Apache MINA - Index for some nice tools for networking :)
// Json