public void flush() { lock.lock(); try { transport.process(); } finally { lock.unlock(); } dispatch(); }
@Override public void flush() { synchronized (lock) { transport.process(); checkServerSASL(); } dispatchExecutor.execute(dispatchRunnable); }
@Override public void run() { final String methodName = "run"; logger.entry(this, methodName); transport.process(); transport.tick(System.currentTimeMillis()); logger.exit(methodName); } };
private void pumpInbound(Buffer buffer) { if (failed) { LOG.trace("Skipping processing of data following transport error: {0}", buffer); return; } // Lets push bytes from vert.x to proton engine. try { ByteBuf data = buffer.getByteBuf(); do { ByteBuffer transportBuffer = transport.tail(); int amount = Math.min(transportBuffer.remaining(), data.readableBytes()); transportBuffer.limit(transportBuffer.position() + amount); data.readBytes(transportBuffer); transport.process(); } while (data.isReadable()); } catch (Exception te) { failed = true; LOG.trace("Exception while processing transport input", te); } }
@Override public void onData(final ByteBuf input) { try { if (isTraceBytes()) { TRACE_BYTES.info("Received: {}", ByteBufUtil.hexDump(input)); } do { ByteBuffer buffer = protonTransport.tail(); int chunkSize = Math.min(buffer.remaining(), input.readableBytes()); buffer.limit(buffer.position() + chunkSize); input.readBytes(buffer); protonTransport.process(); } while (input.isReadable()); // Process the state changes from the latest data and then answer back // any pending updates to the Broker. processUpdates(); pumpToProtonTransport(); } catch (Throwable t) { LOG.warn("Caught problem during data processing: {}", t.getMessage(), t); fireProviderException(t); } }
@Override public void onData(final ByteBuf input) { try { if (isTraceBytes()) { TRACE_BYTES.info("Received: {}", ByteBufUtil.hexDump(input)); } do { ByteBuffer buffer = protonTransport.tail(); int chunkSize = Math.min(buffer.remaining(), input.readableBytes()); buffer.limit(buffer.position() + chunkSize); input.readBytes(buffer); protonTransport.process(); } while (input.isReadable()); // Process the state changes from the latest data and then answer back // any pending updates to the Broker. processUpdates(); pumpToProtonTransport(); } catch (Throwable t) { LOG.warn("Caught problem during data processing: {}", t.getMessage(), t); fireProviderException(t); } }
_inputDone = true; } else if (bytesRead > 0) { _transport.process(); processed = true;
} else if (bytesRead > 0) { try { _transport.process(); } catch (TransportException e) { _logger.log(Level.SEVERE, this + " error processing input", e);
@Override public void run(Selectable selectable) { Reactor reactor = selectable.getReactor(); Transport transport = ((SelectableImpl)selectable).getTransport(); int capacity = transport.capacity(); if (capacity > 0) { SocketChannel socketChannel = (SocketChannel)selectable.getChannel(); try { int n = socketChannel.read(transport.tail()); if (n == -1) { transport.close_tail(); } else { transport.process(); } } catch (IOException | TransportException e) { ErrorCondition condition = new ErrorCondition(); condition.setCondition(Symbol.getSymbol("proton:io")); condition.setDescription(e.getMessage()); transport.setCondition(condition); transport.close_tail(); } } // (Comment from C code:) occasionally transport events aren't // generated when expected, so the following hack ensures we // always update the selector update(selectable); reactor.update(selectable); } };
@Override public void run(Selectable selectable) { Reactor reactor = selectable.getReactor(); Transport transport = ((SelectableImpl)selectable).getTransport(); int capacity = transport.capacity(); if (capacity > 0) { SocketChannel socketChannel = (SocketChannel)selectable.getChannel(); try { int n = socketChannel.read(transport.tail()); if (n == -1) { transport.close_tail(); } else { transport.process(); } } catch (IOException e) { ErrorCondition condition = new ErrorCondition(); condition.setCondition(Symbol.getSymbol("proton:io")); condition.setDescription(e.getMessage()); transport.setCondition(condition); transport.close_tail(); } } // (Comment from C code:) occasionally transport events aren't // generated when expected, so the following hack ensures we // always update the selector update(selectable); reactor.update(selectable); } };
engineConnection.transport.process(); process(engineConnection.collector);