private StreamWebSocket(StreamAllocation streamAllocation, Random random, ExecutorService replyExecutor, WebSocketListener listener, String url) { super(true /* is client */, streamAllocation.connection().source, streamAllocation.connection().sink, random, replyExecutor, listener, url); this.streamAllocation = streamAllocation; this.replyExecutor = replyExecutor; }
@Override protected void close() throws IOException { replyExecutor.shutdown(); streamAllocation.noNewStreams(); streamAllocation.streamFinished(streamAllocation.stream()); } }
streamAllocation.release();
streamAllocation.release(); streamAllocation = null;