Set TCPNODELAY as default.
This commit is contained in:
parent
370d6451c7
commit
852afeb565
2 changed files with 4 additions and 0 deletions
|
|
@ -50,6 +50,8 @@ object Tcp extends ExtensionKey[TcpExt] {
|
|||
* [[akka.io.Inet.SocketOption]] to enable or disable TCP_NODELAY
|
||||
* (disable or enable Nagle's algorithm)
|
||||
*
|
||||
* Please note, that TCP_NODELAY is enabled by default.
|
||||
*
|
||||
* For more information see [[java.net.Socket.setTcpNoDelay]]
|
||||
*/
|
||||
case class TcpNoDelay(on: Boolean) extends SocketOption {
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ private[io] abstract class TcpConnection(val channel: SocketChannel,
|
|||
|
||||
/** used in subclasses to start the common machinery above once a channel is connected */
|
||||
def completeConnect(commander: ActorRef, options: immutable.Traversable[SocketOption]): Unit = {
|
||||
// Turn off Nagle's algorithm by default
|
||||
channel.socket.setTcpNoDelay(true)
|
||||
options.foreach(_.afterConnect(channel.socket))
|
||||
|
||||
commander ! Connected(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue