Did you check out these two samples?
They both implement TCP Sockets in Java to communicate with in this case the client interfaces.