protected ProxyReactorBase(INode nodeConfig, IMessageEncoder encoder, IMessageDecoder decoder, IByteBufAllocator allocator, int bufferSize = NetworkConstants.DEFAULT_BUFFER_SIZE) : base(nodeConfig, encoder, decoder, allocator, bufferSize) { BufferSize = bufferSize; networkState = CreateNetworkState(Listener, this.LocalEndpoint, allocator.Buffer(bufferSize), bufferSize); }
public SerialPortReactor(NodeConfig nodeConfig, IMessageEncoder encoder, IMessageDecoder decoder, IByteBufAllocator allocator, int bufferSize = NetworkConstants.DEFAULT_BUFFER_SIZE) : base(nodeConfig, encoder, decoder, allocator, bufferSize) { networkState = CreateNetworkState(Listener, this.LocalEndpoint, allocator.Buffer(bufferSize), bufferSize); }
/// <summary> /// Expand the existing cumulative <see cref="IByteBuf" />. /// </summary> private static IByteBuf ExpandCumulation(IByteBufAllocator alloc, IByteBuf cumulation, int readable) { var old = cumulation; cumulation = alloc.Buffer(old.ReadableBytes + readable); cumulation.WriteBytes(old); old.Release(); return cumulation; }
/// <summary> /// Expand the existing cumulative <see cref="IByteBuf" />. /// </summary> private static IByteBuf ExpandCumulation(IByteBufAllocator alloc, IByteBuf cumulation, int readable) { var old = cumulation; cumulation = alloc.Buffer(old.ReadableBytes + readable); cumulation.WriteBytes(old); old.Release(); return(cumulation); }
public IByteBuf Allocate(IByteBufAllocator allocator) { return(allocator.Buffer(_bufferSize)); }
public static IByteBuf Buffer() { return(Alloc.Buffer()); }
public IByteBuf Allocate(IByteBufAllocator allocator) { return allocator.Buffer(_bufferSize); }