/******************************************************************************************************************* * * * ******************************************************************************************************************/ @Nonnull private static SessionOutputBufferImpl sessionOutputBufferFrom (final @Nonnull OutputStream os) { final HttpTransportMetricsImpl metrics = new HttpTransportMetricsImpl(); final SessionOutputBufferImpl sob = new SessionOutputBufferImpl(metrics, 100); sob.bind(os); return sob; }
/** * Binds this connection to the given {@link Socket}. This socket will be * used by the connection to send and receive data. * <p> * After this method's execution the connection status will be reported * as open and the {@link #isOpen()} will return {@code true}. * * @param socket the socket. * @throws IOException in case of an I/O error. */ protected void bind(final Socket socket) throws IOException { Args.notNull(socket, "Socket"); this.socketHolder.set(socket); this.inbuffer.bind(null); this.outbuffer.bind(null); }
/** * Binds this connection to the given {@link Socket}. This socket will be * used by the connection to send and receive data. * <p> * After this method's execution the connection status will be reported * as open and the {@link #isOpen()} will return {@code true}. * * @param socket the socket. * @throws IOException in case of an I/O error. */ protected void bind(final Socket socket) throws IOException { Args.notNull(socket, "Socket"); this.socketHolder.set(socket); this.inbuffer.bind(null); this.outbuffer.bind(null); }
/** * Binds this connection to the given {@link Socket}. This socket will be * used by the connection to send and receive data. * <p/> * After this method's execution the connection status will be reported * as open and the {@link #isOpen()} will return <code>true</code>. * * @param socket the socket. * @throws IOException in case of an I/O error. */ protected void bind(final Socket socket) throws IOException { Args.notNull(socket, "Socket"); this.socketHolder.set(socket); this.inbuffer.bind(null); this.outbuffer.bind(null); }
/** * Binds this connection to the given {@link Socket}. This socket will be * used by the connection to send and receive data. * <p> * After this method's execution the connection status will be reported * as open and the {@link #isOpen()} will return {@code true}. * * @param socket the socket. * @throws IOException in case of an I/O error. */ protected void bind(final Socket socket) throws IOException { Args.notNull(socket, "Socket"); this.socketHolder.set(socket); this.inbuffer.bind(null); this.outbuffer.bind(null); }
/** * Binds this connection to the given {@link Socket}. This socket will be * used by the connection to send and receive data. * <p> * After this method's execution the connection status will be reported * as open and the {@link #isOpen()} will return {@code true}. * * @param socket the socket. * @throws IOException in case of an I/O error. */ protected void bind(final Socket socket) throws IOException { Args.notNull(socket, "Socket"); this.socketHolder.set(socket); this.inbuffer.bind(null); this.outbuffer.bind(null); }
/** * Binds this connection to the given {@link Socket}. This socket will be * used by the connection to send and receive data. * <p/> * After this method's execution the connection status will be reported * as open and the {@link #isOpen()} will return <code>true</code>. * * @param socket the socket. * @throws IOException in case of an I/O error. */ protected void bind(final Socket socket) throws IOException { Args.notNull(socket, "Socket"); this.socket = socket; this.open = true; this.inbuffer.bind(null); this.outbuffer.bind(null); }
protected void ensureOpen() throws IOException { final Socket socket = this.socketHolder.get(); Asserts.check(socket != null, "Connection is not open"); if (!this.inbuffer.isBound()) { this.inbuffer.bind(getSocketInputStream(socket)); } if (!this.outbuffer.isBound()) { this.outbuffer.bind(getSocketOutputStream(socket)); } }
protected void ensureOpen() throws IOException { final Socket socket = this.socketHolder.get(); if (socket == null) { throw new ConnectionClosedException("Connection is closed"); } if (!this.inbuffer.isBound()) { this.inbuffer.bind(getSocketInputStream(socket)); } if (!this.outbuffer.isBound()) { this.outbuffer.bind(getSocketOutputStream(socket)); } }
protected void ensureOpen() throws IOException { final Socket socket = this.socketHolder.get(); if (socket == null) { throw new ConnectionClosedException("Connection is closed"); } if (!this.inbuffer.isBound()) { this.inbuffer.bind(getSocketInputStream(socket)); } if (!this.outbuffer.isBound()) { this.outbuffer.bind(getSocketOutputStream(socket)); } }
protected void ensureOpen() throws IOException { final Socket socket = this.socketHolder.get(); if (socket == null) { throw new ConnectionClosedException("Connection is closed"); } if (!this.inbuffer.isBound()) { this.inbuffer.bind(getSocketInputStream(socket)); } if (!this.outbuffer.isBound()) { this.outbuffer.bind(getSocketOutputStream(socket)); } }
protected void ensureOpen() throws IOException { final Socket socket = this.socketHolder.get(); if (socket == null) { throw new ConnectionClosedException("Connection is closed"); } if (!this.inbuffer.isBound()) { this.inbuffer.bind(getSocketInputStream(socket)); } if (!this.outbuffer.isBound()) { this.outbuffer.bind(getSocketOutputStream(socket)); } }
protected void ensureOpen() throws IOException { Asserts.check(this.open, "Connection is not open"); if (!this.inbuffer.isBound()) { this.inbuffer.bind(getSocketInputStream(this.socket)); } if (!this.outbuffer.isBound()) { this.outbuffer.bind(getSocketOutputStream(this.socket)); } }
HttpEventCodec(Map<String, String> env, InputStream input, OutputStream output) { this.env = env; SessionInputBufferImpl sib = new SessionInputBufferImpl(new HttpTransportMetricsImpl(), 65535); sib.bind(Objects.requireNonNull(input)); this.sib = sib; SessionOutputBufferImpl sob = new SessionOutputBufferImpl(new HttpTransportMetricsImpl(), 65535); sob.bind(output); this.sob = sob; parser = new DefaultHttpRequestParserFactory(null, null).create(sib, MessageConstraints.custom().setMaxHeaderCount(65535).setMaxLineLength(65535).build()); }