Two tutorials are available:
Introduction to Peer-to-Peer Sockets
How to Create Peer-to-Peer Web Servers, Servlets, JSPs, and XML-RPC Clients and Servers