publicvoid run () throws Exception { try { if (isClient) {
client = new Socket (clHost, clPort);
clis = client.getInputStream();
clos = client.getOutputStream();
client.setOOBInline (true); if (client.getOOBInline() != true) { thrownew RuntimeException ("Setting OOBINLINE failed");
}
} if (isServer) {
server = listener.accept ();
sis = server.getInputStream();
sos = server.getOutputStream();
} if (isClient) {
clos.write ("Hello".getBytes ());
client.sendUrgentData (100);
clos.write ("world".getBytes ());
} // read Hello world from server (during which oob byte must have been dropped)
String s = "Helloworld"; if (isServer) { for (int y=0; y<s.length(); y++) { int c = sis.read (); if (c != (int)s.charAt (y)) { thrownew RuntimeException ("Unexpected character read");
}
} // Do the same from server to client
sos.write ("Hello".getBytes ());
server.sendUrgentData (101);
sos.write ("World".getBytes ());
} if (isClient) { // read Hello world from client (during which oob byte must have been read)
s="Hello"; for (int y=0; y<s.length(); y++) { int c = clis.read (); if (c != (int)s.charAt (y)) { thrownew RuntimeException ("Unexpected character read");
}
} if (clis.read() != 101) { thrownew RuntimeException ("OOB byte not received");
}
s="World"; for (int y=0; y<s.length(); y++) { int c = clis.read (); if (c != (int)s.charAt (y)) { thrownew RuntimeException ("Unexpected character read");
}
}
}
} finally { if (listener != null) listener.close(); if (client != null) client.close (); if (server != null) server.close ();
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.