mina“丢弃输出数据包,因为通道正在关闭”缺少命令输出

时间:2015-04-21 11:52:10

标签: scala ssh mina

我们使用Mina sshd客户端连接到基于Linux的服务器。 看起来当我们获得命令SSH_MSG_CHANNEL_DATA以及Received SSH_MSG_CHANNEL_EOF时,Mina不会将数据放入输出缓冲区并记录:“ChannelExec - 丢弃输出数据包,因为通道正在关闭”

这是我的示例代码和Mina调试。

这是我在使用Mina异步错误的错误吗?

val channel: ChannelExec = clientSession.createExecChannel(cmd)
channel.setupSensibleDefaultPty()
channel.setUsePty(true)
channel.setStreaming(ClientChannel.Streaming.Async)

val bais: ByteArrayInputStream = new ByteArrayInputStream(Array[Byte]())
channel.setIn(bais)

val openFuture = channel.open()

val baosOut: ByteArrayOutputStream = new ByteArrayOutputStream()

openFuture.addListener(new SshFutureListener[OpenFuture] {
    override def operationComplete(future: OpenFuture): Unit = {
        channel.getAsyncOut.read(new Buffer).addListener(new SshFutureListener[IoReadFuture] {
            def operationComplete(future: IoReadFuture) {
                readBuffer(channel, future, channel.getAsyncOut, baosOut, this)
            }
        })
    }
})
openFuture.await(connectionConfig.maxConnTime)

DEBUG Nio2Session - Read 244 bytes    
DEBUG ChannelExec - Received SSH_MSG_CHANNEL_WINDOW_ADJUST on channel ChannelExec[id=153, recipient=0]    
DEBUG Window - Increase client remote window by 2097152 up to 2097152    
DEBUG ChannelExec - Received SSH_MSG_CHANNEL_DATA on channel ChannelExec[id=153, recipient=0]    
DEBUG ChannelExec - Received SSH_MSG_CHANNEL_EOF on channel ChannelExec[id=153, recipient=0]    
DEBUG ChannelExec - Received SSH_MSG_CHANNEL_REQUEST exit-status on channel ChannelExec[id=153, recipient=0] (wantReply false)    
DEBUG ChannelExec - Received SSH_MSG_CHANNEL_CLOSE on channel ChannelExec[id=153, recipient=0]    
DEBUG ChannelExec - Closing ChannelExec[id=153, recipient=0] gracefully    
DEBUG ChannelSession$1 - Closing ChannelAsyncOutputStream[ChannelExec[id=153, recipient=0]] gracefully    
DEBUG ChannelExec - Send SSH_MSG_CHANNEL_EOF on channel ChannelExec[id=153, recipient=0]    
DEBUG ChannelExec - Discarding output packet because channel is being closed    
DEBUG ChannelSession$1 - ChannelAsyncOutputStream[ChannelExec[id=153, recipient=0]] closed    
DEBUG ChannelAsyncInputStream - Closing ChannelAsyncInputStream[ChannelExec[id=153, recipient=0]] gracefully    
DEBUG ChannelAsyncInputStream - ChannelAsyncInputStream[ChannelExec[id=153, recipient=0]] closed    
DEBUG ChannelAsyncInputStream - Closing ChannelAsyncInputStream[ChannelExec[id=153, recipient=0]] gracefully    
DEBUG ChannelAsyncInputStream - ChannelAsyncInputStream[ChannelExec[id=153, recipient=0]] closed    
DEBUG ChannelExec - Send SSH_MSG_CHANNEL_CLOSE on channel ChannelExec[id=153, recipient=0]    
DEBUG Nio2Session - Writing 52 bytes    
DEBUG Nio2Session - Finished writing    
DEBUG ChannelExec - Message SSH_MSG_CHANNEL_CLOSE written on channel ChannelExec[id=153, recipient=0]    
DEBUG ChannelSession$1 - ChannelAsyncOutputStream[ChannelExec[id=153, recipient=0]] is already closed    
DEBUG ChannelAsyncInputStream - ChannelAsyncInputStream[ChannelExec[id=153, recipient=0]] is already closed    
DEBUG ChannelAsyncInputStream - ChannelAsyncInputStream[ChannelExec[id=153, recipient=0]] is already closed    
DEBUG ChannelExec - ChannelExec[id=153, recipient=0] closed

0 个答案:

没有答案