Stats

480 Contributors: 15
2017-05-18
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Networking

Download java eBook

Syntax

  • new Socket("localhost", 1234); //Connects to a server at address "localhost" and port 1234
  • new SocketServer("localhost", 1234); //Creates a socket server that can listen for new sockets at address localhost and port 1234
  • socketServer.accept(); //Accepts a new Socket object which can be used to communicate with the client

Related Examples