You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use keep-alive tcp connect between client and server, but when the client re-connect to the server, during the re-connect time,the server do not receive the packet from the client ,but the client operationComplete is true, how does it happen? operationComplete method called does not mean the packet has successfully send to the server?
channel.writeAndFlush(msg).addListener(new ChannelFutureListener() {
override def operationComplete(future: ChannelFuture): Unit = future.isSuccess match {
case true =>
logInfo(s"successfully send msg to Server")
case _ =>
logError(s"fail send msg to Server)
}
}
The text was updated successfully, but these errors were encountered:
operationComplete method called does not mean the packet has successfully send to the server?
The future should complete when msg has been flushed to the underlying OS, or if a failure occurred before this could happen.
during the re-connect time
The sequence of events is not clear. Can you clarify and/or provide a reproducer? For example which peer initiates a close, if/when does the other peer receive a channelInactive, and which socket is being used to send the data that is not being received as expected (the one before close, or a new one where you have received a channelActive for).
@windpiger the future is notified once the syscall success. This not means that it was transmitted and received by the remote peer. For this you will need to implement some kind of acknowledge into your protocol.
I use keep-alive tcp connect between client and server, but when the client re-connect to the server, during the re-connect time,the server do not receive the packet from the client ,but the client operationComplete is true, how does it happen? operationComplete method called does not mean the packet has successfully send to the server?
channel.writeAndFlush(msg).addListener(new ChannelFutureListener() {
override def operationComplete(future: ChannelFuture): Unit = future.isSuccess match {
case true =>
logInfo(s"successfully send msg to Server")
case _ =>
logError(s"fail send msg to Server)
}
}
The text was updated successfully, but these errors were encountered: