-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardened flushing by sending a final "null" message #990
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -32,7 +32,8 @@ private[remote] trait TcpHandlers extends CommonHandlers { | ||
} | } | ||
|
|
||
override def onMessage(ctx: ChannelHandlerContext, e: MessageEvent) { | override def onMessage(ctx: ChannelHandlerContext, e: MessageEvent) { | ||
notifyListener(e.getChannel, InboundPayload(ByteString(e.getMessage.asInstanceOf[ChannelBuffer].array()))) | val bytes: Array[Byte] = e.getMessage.asInstanceOf[ChannelBuffer].array() | ||
if (bytes.length > 0) notifyListener(e.getChannel, InboundPayload(ByteString(bytes))) | |||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this imply that application messages can't be 0 bytes? Is that an issue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's not an application message tho? It's the inbound payload (Akka protocol), right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's even lower layer. This is the payload of UDP packets, or length |
|||
} | } | ||
|
|
||
override def onException(ctx: ChannelHandlerContext, e: ExceptionEvent) { | override def onException(ctx: ChannelHandlerContext, e: ExceptionEvent) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding the following to NettyFutureBridge:
And then you can write shutdown as something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, Cool!