File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
src/de/javasocketapi/core Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ public void connect() throws IOException {
4040 //initialise socket
4141 this .socket = new Socket (this .hostname , this .port );
4242 this .socket .setTcpNoDelay (true );
43+ this .socket .setKeepAlive (true );
44+ this .socket .setOOBInline (true );
45+ this .socket .setPerformancePreferences (0 ,1 ,2 );
4346 }
4447 //start reading and writing
4548 this .inputStreamThread = new InputStreamThread (this );
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ public void connect() throws IOException {
2525 if (serverSocket == null ) {
2626 //initialise serverSocket
2727 this .serverSocket = new ServerSocket (this .port );
28+ this .serverSocket .setReuseAddress (false );
29+ this .serverSocket .setPerformancePreferences (0 ,1 , 2 );
2830 }
2931 //start accepting clients
3032 this .serverSocketAcceptingThread = new ServerSocketAcceptingThread (this .serverSocket );
You can’t perform that action at this time.
0 commit comments