Skip to content

Commit

Permalink
Use setOption directly instead of going via socket()
Browse files Browse the repository at this point in the history
  • Loading branch information
gartens committed Apr 4, 2024
1 parent 9ffd641 commit 274a0a7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.EOFException;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.StandardSocketOptions;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.SocketChannel;
Expand All @@ -33,7 +34,7 @@ public class PlainTransport implements Transport {

public PlainTransport( String host, int port ) throws IOException {
con = SocketChannel.open( new InetSocketAddress( host, port ) );
con.socket().setTcpNoDelay( true );
con.setOption( StandardSocketOptions.TCP_NODELAY, true );
}


Expand Down

0 comments on commit 274a0a7

Please sign in to comment.