当前位置: 首页>>代码示例>>Java>>正文


Java ChannelHandlerContext.flush方法代码示例

本文整理汇总了Java中io.netty.channel.ChannelHandlerContext.flush方法的典型用法代码示例。如果您正苦于以下问题:Java ChannelHandlerContext.flush方法的具体用法?Java ChannelHandlerContext.flush怎么用?Java ChannelHandlerContext.flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.netty.channel.ChannelHandlerContext的用法示例。


在下文中一共展示了ChannelHandlerContext.flush方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processInformationTransfer

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
private void processInformationTransfer ( final ChannelHandlerContext ctx, final Object msg )
{
    final List<Object> out = new LinkedList<> ();

    logger.trace ( "Passing to manager: {}", msg );
    final ByteBuf errorData = this.manager.receiveMessage ( (InformationTransfer)msg, out );
    if ( errorData != null )
    {
        logger.debug ( "Write error reply" );
        writeMessageToChannel ( ctx, errorData, null );
        ctx.flush ();
    }

    for ( final Object newMsg : out )
    {
        logger.trace ( "Passing message: {}", newMsg );
        ctx.fireChannelRead ( newMsg );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:20,代码来源:MessageChannel.java

示例2: handleAck

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
protected synchronized void handleAck ( final ChannelHandlerContext ctx, final int receiveSequenceNumber )
{
    logger.trace ( "Received ACK up to: {}", receiveSequenceNumber );

    // handle ack
    this.ackBuffer.gotAck ( receiveSequenceNumber );

    // now try to flush messages from the buffer
    sendFromBuffer ();
    // try to send from sources
    sendFromSources ();

    ctx.flush ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:15,代码来源:MessageChannel.java

示例3: onDataRead

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding,
        boolean endOfStream) {
    int processed = data.readableBytes() + padding;
    encoder().writeData(ctx, streamId, data.retain(), 0, true, ctx.newPromise());
    ctx.flush();
    return processed;
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:8,代码来源:Http2TestHandler.java

示例4: onHeadersRead

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
@Override
void onHeadersRead(ChannelHandlerContext ctx, int streamId, boolean endOfStream,
        Http2Headers headers) {
    encoder().writeHeaders(
            ctx, streamId, createDefaultResponseHeaders(), 0, false, ctx.newPromise());
    encoder().writeData(
            ctx, streamId, RESPONSE_BYTES.duplicate(), 0, false, ctx.newPromise());
    Http2Headers responseTrailers = createResponseHeadersFromRequestHeaders(headers).add(
            "trailer", "value1", "Value2");
    encoder().writeHeaders(ctx, streamId, responseTrailers, 0, true, ctx.newPromise());
    ctx.flush();
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:13,代码来源:Http2TestHandler.java

示例5: sendTransmissionSimpleReply

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
private void sendTransmissionSimpleReply(ChannelHandlerContext ctx, int error, long handle, ByteBuf data) {
    synchronized (this) {
        ByteBuf bbr = ctx.alloc().buffer(16);
        bbr.writeInt(Protocol.REPLY_MAGIC);
        bbr.writeInt(error); // zero for okay
        bbr.writeLong(handle);
        ctx.write(bbr);
        if (data != null) {
            ctx.write(data);
        }
    }
    ctx.flush();
    logPendingOperations();
}
 
开发者ID:MineboxOS,项目名称:tools,代码行数:15,代码来源:TransmissionPhase.java

示例6: write

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
    synchronized (pendings) {
        pendings.add(msg);
    }
    if (ctx.isRemoved()) {
        flushPendings(ctx);
        ctx.flush();
    }
}
 
开发者ID:chhsiao90,项目名称:nitmproxy,代码行数:11,代码来源:TlsHandler.java

示例7: sendResponseString

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
void sendResponseString(ChannelHandlerContext ctx, int streamId, String responseString) {
    ByteBuf content = ctx.alloc().buffer();
    ByteBufUtil.writeAscii(content, responseString);
    encoder().writeHeaders(
            ctx, streamId, createDefaultResponseHeaders(), 0, false, ctx.newPromise());
    encoder().writeData(ctx, streamId, content, 0, true, ctx.newPromise());
    ctx.flush();
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:9,代码来源:Http2TestHandler.java

示例8: channelReadComplete

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
@Override
public void channelReadComplete(ChannelHandlerContext ctx) {
  ctx.flush();
}
 
开发者ID:osswangxining,项目名称:iotplatform,代码行数:5,代码来源:MqttTransportHandler.java

示例9: channelReadComplete

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
@Override
public void channelReadComplete(ChannelHandlerContext ctx) {
    ctx.flush();
}
 
开发者ID:ninelook,项目名称:wecard-server,代码行数:5,代码来源:NettyServerHandler.java

示例10: channelReadComplete

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
  ctx.flush();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:HdfsWriter.java

示例11: channelReadComplete

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
	ctx.flush();
}
 
开发者ID:sylinklee,项目名称:netto_rpc,代码行数:5,代码来源:NettyNettoMessageHandler.java

示例12: channelReadComplete

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
    ctx.flush();
}
 
开发者ID:FightForSub,项目名称:FFS-PubSub,代码行数:5,代码来源:WebSocketHandler.java

示例13: channelReadComplete

import io.netty.channel.ChannelHandlerContext; //导入方法依赖的package包/类
@Override
public void channelReadComplete(ChannelHandlerContext ctx) {
	ctx.flush();
}
 
开发者ID:breakEval13,项目名称:NSS,代码行数:5,代码来源:SocksServerHandler.java


注:本文中的io.netty.channel.ChannelHandlerContext.flush方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。