Skip to content

Instantly share code, notes, and snippets.

View Szustarol's full-sized avatar

Karol Szustakowski Szustarol

  • Helmholtz Munich
  • Munich, Germany
  • 19:16 (UTC +02:00)
View GitHub Profile
@Szustarol
Szustarol / java_example.java
Created October 23, 2023 16:42
Minimal reproducible example - TCP wait
//server code
public class Server {
public static void main(String [] args) throws IOException {
ServerSocket serverSocket = new ServerSocket(50004, 2000);
int counter = 0;
while(true){
System.out.println(counter + " Starting to accept connection");
Socket socket = serverSocket.accept();
System.out.println(counter + " Connection accepted");
socket.setTcpNoDelay(true);