Every network client starts with naming a peer (URI and InetAddress) and exchanging bytes over TCP (reliable byte stream) or UDP (unreliable datagrams). Getting timeouts and resource closing right separates toy demos from resilient services.
More lessons in Complete Core Java