public boolean isLocallyInitiatedStream(final int streamId) { assert streamId > 0; return isServer() ^ ((streamId % 2) != 0); // Same as // return isServer() ? // (streamId % 2) == 0 : // (streamId % 2) == 1; }
public boolean isLocallyInitiatedStream(final int streamId) { assert streamId > 0; return isServer() ^ ((streamId % 2) != 0); // Same as // return isServer() ? // (streamId % 2) == 0 : // (streamId % 2) == 1; }
public boolean isLocallyInitiatedStream(final int streamId) { assert streamId > 0; return isServer() ^ ((streamId % 2) != 0); // Same as // return isServer() ? // (streamId % 2) == 0 : // (streamId % 2) == 1; }
public boolean isLocallyInitiatedStream(final int streamId) { assert streamId > 0; return isServer() ^ ((streamId % 2) != 0); // Same as // return isServer() ? // (streamId % 2) == 0 : // (streamId % 2) == 1; }
public boolean isLocallyInitiatedStream(final int streamId) { assert streamId > 0; return isServer() ^ ((streamId % 2) != 0); // Same as // return isServer() ? // (streamId % 2) == 0 : // (streamId % 2) == 1; }
public boolean isLocallyInitiatedStream(final int streamId) { assert streamId > 0; return isServer() ^ ((streamId % 2) != 0); // Same as // return isServer() ? // (streamId % 2) == 0 : // (streamId % 2) == 1; }
public boolean isLocallyInitiatedStream(final int streamId) { assert streamId > 0; return isServer() ^ ((streamId % 2) != 0); // Same as // return isServer() ? // (streamId % 2) == 0 : // (streamId % 2) == 1; }
public boolean isLocallyInitiatedStream(final int streamId) { assert streamId > 0; return isServer() ^ ((streamId % 2) != 0); // Same as // return isServer() ? // (streamId % 2) == 0 : // (streamId % 2) == 1; }
public boolean isLocallyInitiatedStream(final int streamId) { assert streamId > 0; return isServer() ^ ((streamId % 2) != 0); // Same as // return isServer() ? // (streamId % 2) == 0 : // (streamId % 2) == 1; }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
private void registerUpgradeStream(final Http2Stream stream) throws Http2StreamException { synchronized(sessionLock) { if (isClosed()) { throw new Http2StreamException(Http2Stream.UPGRADE_STREAM_ID, ErrorCode.REFUSED_STREAM, "Session is closed"); } registerStream(Http2Stream.UPGRADE_STREAM_ID, stream); if (!isServer()) { lastLocalStreamId = Http2Stream.UPGRADE_STREAM_ID; } } }
/** * Construct upgrade stream, which is half HTTP, half HTTP2 * * @param http2Session the {@link Http2Session} for this {@link Http2Stream}. * @param request the {@link HttpRequestPacket} initiating the stream. * @param priority the priority of this stream. */ protected Http2Stream(final Http2Session http2Session, final HttpRequestPacket request, final int priority) { this.http2Session = http2Session; this.request = request; this.streamId = UPGRADE_STREAM_ID; this.parentStreamId = 0; this.priority = priority; this.exclusive = false; inputBuffer = http2Session.isServer() ? new UpgradeInputBuffer(this) : new DefaultInputBuffer(this); outputSink = http2Session.isServer() ? new DefaultOutputSink(this) : new UpgradeOutputSink(http2Session); HTTP_RQST_HTTP2_STREAM_ATTR.set(request, this); }
/** * Construct upgrade stream, which is half HTTP, half HTTP2 * * @param http2Session the {@link Http2Session} for this {@link Http2Stream}. * @param request the {@link HttpRequestPacket} initiating the stream. * @param priority the priority of this stream. */ protected Http2Stream(final Http2Session http2Session, final HttpRequestPacket request, final int priority) { this.http2Session = http2Session; this.request = request; this.streamId = UPGRADE_STREAM_ID; this.parentStreamId = 0; this.priority = priority; this.exclusive = false; inputBuffer = http2Session.isServer() ? new UpgradeInputBuffer(this) : new DefaultInputBuffer(this); outputSink = http2Session.isServer() ? new DefaultOutputSink(this) : new UpgradeOutputSink(http2Session); HTTP_RQST_HTTP2_STREAM_ATTR.set(request, this); }