本文整理汇总了C++中ChannelHandlerContext::SendUpstream方法的典型用法代码示例。如果您正苦于以下问题:C++ ChannelHandlerContext::SendUpstream方法的具体用法?C++ ChannelHandlerContext::SendUpstream怎么用?C++ ChannelHandlerContext::SendUpstream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChannelHandlerContext
的用法示例。
在下文中一共展示了ChannelHandlerContext::SendUpstream方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Cleanup
void Cleanup(ChannelHandlerContext& ctx, ChannelStateEvent& e)
{
if (!m_cumulation.Readable())
{
ctx.SendUpstream(e);
return;
}
// Make sure all frames are read before notifying a closed channel.
CallDecode(ctx, ctx.GetChannel(), m_cumulation);
// Call decodeLast() finally. Please note that decodeLast() is
// called even if there's nothing more to read from the buffer to
// notify a user that the connection was closed explicitly.
FrameDecodeResult<T> partialFrame = DecodeLast(ctx,
ctx.GetChannel(), m_cumulation);
if (partialFrame.msg != NULL)
{
fire_message_received(ctx, partialFrame.msg,
partialFrame.destructor);
}
ctx.SendUpstream(e);
}
示例2: ExceptionCaught
void ExceptionCaught(ChannelHandlerContext& ctx,
ExceptionEvent& e)
{
ctx.SendUpstream(e);
}
示例3: ChannelClosed
void ChannelClosed(ChannelHandlerContext& ctx, ChannelStateEvent& e)
{
ctx.SendUpstream(e);
}
示例4: fire_message_received
inline bool fire_message_received(ChannelHandlerContext& ctx, T* message,
typename Type<T>::Destructor* destructor)
{
MessageEvent<T> event(ctx.GetChannel(), message, destructor, true);
return ctx.SendUpstream(event);
}