Merge pull request #16731 from akka/wip-16653-netcat-TcpNoDelay-master-patriknw

=act #16653 swallow exception from setTcpNoDelay (for validation)
This commit is contained in:
Patrik Nordwall 2015-01-28 11:08:47 +01:00
commit 0cea1a47ae

View file

@ -181,7 +181,12 @@ private[io] abstract class TcpConnection(val tcp: TcpExt, val channel: SocketCha
def completeConnect(registration: ChannelRegistration, commander: ActorRef,
options: immutable.Traversable[SocketOption]): Unit = {
// Turn off Nagle's algorithm by default
channel.socket.setTcpNoDelay(true)
try channel.socket.setTcpNoDelay(true) catch {
case e: SocketException
// as reported in #16653 some versions of netcat (`nc -z`) doesn't allow setTcpNoDelay
// continue anyway
log.debug("Could not enable TcpNoDelay: {}", e.getMessage)
}
options.foreach(_.afterConnect(channel))
commander ! Connected(