protected HttpTunnelServerChannel(ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, ServerSocketChannelFactory inboundFactory, ChannelGroup realConnections) { super(factory, pipeline, sink); tunnelIdPrefix = Long.toHexString(random.nextLong()); tunnels = new ConcurrentHashMap<String, HttpTunnelAcceptedChannel>(); config = new HttpTunnelServerChannelConfig(); realChannel = inboundFactory.newChannel(this.createRealPipeline(realConnections)); config.setRealChannel(realChannel); opened = new AtomicBoolean(true); bindState = new AtomicReference<BindState>(BindState.UNBOUND); realConnections.add(realChannel); Channels.fireChannelOpen(this); }
public NioSocketChannel( Channel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, SocketChannel socket, NioWorker worker) { super(parent, factory, pipeline, sink, worker, socket); config = new DefaultNioSocketChannelConfig(socket.socket()); }
NioClientSocketChannel( ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, NioWorker worker) { super(null, factory, pipeline, sink, newSocket(), worker); fireChannelOpen(this); }
protected AbstractNioChannel( Integer id, Channel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, AbstractNioWorker worker, C ch) { super(id, parent, factory, pipeline, sink); this.worker = worker; channel = ch; }
protected AbstractNioChannel( Channel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, AbstractNioWorker worker, C ch) { super(parent, factory, pipeline, sink); this.worker = worker; channel = ch; }
protected HttpTunnelAcceptedChannel(HttpTunnelServerChannel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, InetSocketAddress remoteAddress, String tunnelId) { super(parent, factory, pipeline, sink); this.parent = parent; this.remoteAddress = remoteAddress; this.tunnelId = tunnelId; localAddress = parent.getLocalAddress(); config = new HttpTunnelAcceptedChannelConfig(); saturationManager = new SaturationManager(config.getWriteBufferLowWaterMark(), config.getWriteBufferHighWaterMark()); opened = new AtomicBoolean(true); pollChannel = new AtomicReference<Channel>(null); queuedResponses = new ConcurrentLinkedQueue<QueuedResponse>(); incomingBuffer = new IncomingBuffer<ChannelBuffer>(this); Metrics.newGauge(HttpTunnelAcceptedChannel.class, "incomingBuffer", new Gauge<Integer>() { @Override public Integer value() { return incomingBuffer.size(); } }); pingExecutor = Executors.newSingleThreadScheduledExecutor(); pingResponder = new PingResponder(); pingTimeout = new PingTimeout(); pingLock = new Object(); pingTimeoutFuture = null; }
public FakeSocketChannel acceptNewConnection( InetSocketAddress remoteAddress, ChannelSink sink) throws Exception { ChannelPipeline newPipeline = getConfig().getPipelineFactory() .getPipeline(); FakeSocketChannel newChannel = new FakeSocketChannel(this, getFactory(), newPipeline, sink); newChannel.localAddress = localAddress; newChannel.remoteAddress = remoteAddress; fireChannelOpen(newChannel); fireChannelBound(newChannel, newChannel.localAddress); fireChannelConnected(this, newChannel.remoteAddress); return newChannel; }
public IsdnAcceptedChannel( IsdnServerChannel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, IsdnSocketAddress calling, IsdnSocketAddress called, PlciConnectionHandler conn) { super(parent, factory, pipeline, sink); if (parent == null) { throw new NullPointerException("parent"); } if (calling == null) { throw new NullPointerException("callingAddress"); } if (called == null) { throw new NullPointerException("calledAddress"); } this.parent = parent; this.config = new IsdnChannelConfig(); this.callingAddress = calling; this.calledAddress = called; this.plciHandler = conn; this.worker = new IsdnAcceptedWorker(this); setupConfig(parent.getConfig()); // let isdn server channel pipeline factory to create StateMachine // handler based on the protocol for accepted channels (incoming // connection) pipeline.addFirst("IsdnAcceptedChannelStateMachine", getAcceptedChannelStateMachineHandler(this, "IsdnAcceptedChannelStateMachine")); fireChannelOpen(this); fireChannelBound(this, getLocalAddress()); fireChannelConnected(this, getRemoteAddress()); }
public FakeServerSocketChannel(ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink) { super(null, factory, pipeline, sink); }
public FakeSocketChannel(Channel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink) { super(parent, factory, pipeline, sink); this.sink = sink; }