public AbstractConnection(NetworkChannel channel) { this.channel = channel; boolean isAIO = (channel instanceof AsynchronousChannel); if (isAIO) { socketWR = new AIOSocketWR(this); } else { socketWR = new NIOSocketWR(this); } this.isClosed = new AtomicBoolean(false); this.startupTime = TimeUtil.currentTimeMillis(); this.lastReadTime = startupTime; this.lastWriteTime = startupTime; }
PendingFuture(AsynchronousChannel channel, CompletionHandler<V,? super A> handler, A attachment, Object context) { this.channel = channel; this.handler = handler; this.attachment = attachment; this.context = context; }
PendingFuture(AsynchronousChannel channel, CompletionHandler<V,? super A> handler, A attachment) { this.channel = channel; this.handler = handler; this.attachment = attachment; }
public SocketChannelWrapper create() { if(wrapier instanceof AsynchronousChannel) { return new AsyncSocketChannelWrapper((AsynchronousSocketChannel)wrapier); } if(wrapier instanceof SocketChannel) { return new SyncSocketChannelWrapper((SocketChannel)wrapier); } return null; }
PendingFuture(AsynchronousChannel channel) { this(channel, null, null); }
PendingFuture(AsynchronousChannel channel, Object context) { this(channel, null, null, context); }
AsynchronousChannel channel() { return channel; }