@Override protected void longPoll(SocketWrapper<S> socket, Processor<S> processor) { // Same requirements for all AJP connectors socket.setAsync(true); }
@Override protected void longPoll(SocketWrapper<S> socket, P processor) { // Same requirements for all AJP connectors connections.put(socket.getSocket(), processor); socket.setAsync(true); } }
@Override protected void longPoll(SocketWrapper<S> socket, Processor<S> processor) { // Same requirements for all AJP connectors connections.put(socket.getSocket(), processor); socket.setAsync(true); }
@Override protected void longPoll(SocketWrapper<Long> socket, Http11AprProcessor processor) { connections.put(socket.getSocket(), processor); if (processor.isAsync()) { socket.setAsync(true); } else if (processor.comet && proto.endpoint.isRunning()) { ((AprEndpoint) proto.endpoint).getCometPoller().add( socket.getSocket().longValue(), false); } }
@Override protected void longPoll(SocketWrapper<NioChannel> socket, Processor<NioChannel> processor) { connections.put(socket.getSocket(), processor); if (processor.isAsync()) { socket.setAsync(true); } else { // Either: // - this is comet request // - this is an upgraded connection // - the request line/headers have not been completely // read socket.getSocket().getPoller().add(socket.getSocket()); } }
@Override protected void longPoll(SocketWrapper<NioChannel> socket, Processor<NioChannel> processor) { if (processor.isAsync()) { socket.setAsync(true); } else { // Either: // - this is comet request // - this is an upgraded connection // - the request line/headers have not been completely // read socket.getSocket().getPoller().add(socket.getSocket()); } }
@Override protected void longPoll(SocketWrapper<NioChannel> socket, Http11NioProcessor processor) { connections.put(socket.getSocket(), processor); if (processor.isAsync()) { socket.setAsync(true); } else { // Either: // - this is comet request // - the request line/headers have not been completely // read SelectionKey key = socket.getSocket().getIOChannel().keyFor( socket.getSocket().getPoller().getSelector()); key.interestOps(SelectionKey.OP_READ); ((KeyAttachment) socket).interestOps( SelectionKey.OP_READ); } }
socket.setAsync(true); } else { if (state == SocketState.OPEN) {
socket.setAsync(false); recycledProcessors.offer(result); if (state == SocketState.OPEN) {
@Override protected void longPoll(SocketWrapper<Long> socket, Processor<Long> processor) { if (processor.isAsync()) { // Async socket.setAsync(true); } else if (processor.isComet()) { // Comet if (proto.endpoint.isRunning()) { socket.setComet(true); ((AprEndpoint) proto.endpoint).getPoller().add( socket.getSocket().longValue(), proto.endpoint.getSoTimeout(), true, false); } else { // Process a STOP directly ((AprEndpoint) proto.endpoint).processSocket( socket.getSocket().longValue(), SocketStatus.STOP); } } else { // Upgraded Poller p = ((AprEndpoint) proto.endpoint).getPoller(); if (p == null) { // Connector has been stopped release(socket, processor, true, false); } else { p.add(socket.getSocket().longValue(), -1, true, false); } } }
@Override protected void longPoll(SocketWrapper<Long> socket, Processor<Long> processor) { connections.put(socket.getSocket(), processor); if (processor.isAsync()) { // Async socket.setAsync(true); } else if (processor.isComet()) { // Comet if (proto.endpoint.isRunning()) { ((AprEndpoint) proto.endpoint).getCometPoller().add( socket.getSocket().longValue(), proto.endpoint.getSoTimeout(), AprEndpoint.Poller.FLAGS_READ); } else { // Process a STOP directly ((AprEndpoint) proto.endpoint).processSocket( socket.getSocket().longValue(), SocketStatus.STOP); } } else { // Upgraded ((AprEndpoint) proto.endpoint).getPoller().add( socket.getSocket().longValue(), processor.getUpgradeInbound().getReadTimeout(), AprEndpoint.Poller.FLAGS_READ); } }
socket.setAsync(true); } else if (processor.comet) { ((AprEndpoint) proto.endpoint).getCometPoller().add(
if (state != SocketState.LONG) { connections.remove(socket.getSocket()); socket.setAsync(false); recycledProcessors.offer(processor); if (state == SocketState.OPEN) {
wrapper.setAsync(false);
socket.setAsync(false);