mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Li Fangning (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SSHD-722) Failed to setting SO_KEEPALIVE option for sshd server socket
Date Thu, 08 Dec 2016 12:52:58 GMT
Li Fangning created SSHD-722:

             Summary: Failed to setting SO_KEEPALIVE option for sshd server socket
                 Key: SSHD-722
                 URL: https://issues.apache.org/jira/browse/SSHD-722
             Project: MINA SSHD
          Issue Type: Bug
    Affects Versions: 1.3.0
            Reporter: Li Fangning
            Priority: Minor

Use the following code to set the SO_KEEPALIVE property:
  PropertyResolverUtils.updateProperty(sshd, SshServer.SOCKET_KEEPALIVE, true)
I get the error message: Unsupported socket option (SO_KEEPALIVE) to set ......

After I check the code in org.apache.sshd.common.io.nio2.Nio2Acceptor#bind(), I found that
the SO_KEEPALIVE option is set on the AsynchronousServerSocketChannel, i.e. a listening socket
which can only accept new incoming connections and not exchange data. The socket option is
not applicable to a listening socket. (https://docs.oracle.com/javase/8/docs/api/java/nio/channels/AsynchronousServerSocketChannel.html)

Whether this code can be changed to the org.apache.sshd.common.io.nio2.Nio2Acceptor$AcceptCompletionHandler#onCompleted(),
and set the options on the AsynchronousSocketChannel object?

SO_SENDBUF, TCP_NODELAY options have the same issue.

This message was sent by Atlassian JIRA

View raw message