Skip to content

Commit 993f08c

Browse files
author
mint_runs
committed
implements more options for sockets and serversockets
1 parent aebb72d commit 993f08c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/de/javasocketapi/core/Client.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

src/de/javasocketapi/core/Server.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)