Skip to content

Instantly share code, notes, and snippets.

@seyedsahil
Last active February 4, 2021 16:05
Show Gist options
  • Save seyedsahil/b8b38537a7fa72f0f6e5ebc989b4d03c to your computer and use it in GitHub Desktop.
Save seyedsahil/b8b38537a7fa72f0f6e5ebc989b4d03c to your computer and use it in GitHub Desktop.
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
/**
* @author Seyed Sahil
*/
public class Server {
public static void main(String[] args) throws IOException {
ServerSocket serverSocket = new ServerSocket(8080);
System.out.println("Waiting for clients...");
Socket clientSocket = serverSocket.accept();
clientSocket.close();
serverSocket.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment