equal
deleted
inserted
replaced
37 import java.nio.charset.StandardCharsets; |
37 import java.nio.charset.StandardCharsets; |
38 import java.util.*; |
38 import java.util.*; |
39 import java.util.concurrent.ExecutorService; |
39 import java.util.concurrent.ExecutorService; |
40 import java.util.function.Consumer; |
40 import java.util.function.Consumer; |
41 import jdk.incubator.http.internal.common.ByteBufferReference; |
41 import jdk.incubator.http.internal.common.ByteBufferReference; |
42 import jdk.incubator.http.internal.common.BufferHandler; |
|
43 import jdk.incubator.http.internal.common.HttpHeadersImpl; |
42 import jdk.incubator.http.internal.common.HttpHeadersImpl; |
44 import jdk.incubator.http.internal.common.Queue; |
43 import jdk.incubator.http.internal.common.Queue; |
45 import jdk.incubator.http.internal.frame.DataFrame; |
44 import jdk.incubator.http.internal.frame.DataFrame; |
46 import jdk.incubator.http.internal.frame.FramesDecoder; |
45 import jdk.incubator.http.internal.frame.FramesDecoder; |
47 import jdk.incubator.http.internal.frame.FramesEncoder; |
46 import jdk.incubator.http.internal.frame.FramesEncoder; |
232 nextstream = 3; |
231 nextstream = 3; |
233 } |
232 } |
234 |
233 |
235 exec.submit(this::readLoop); |
234 exec.submit(this::readLoop); |
236 exec.submit(this::writeLoop); |
235 exec.submit(this::writeLoop); |
237 } |
|
238 |
|
239 static class BufferPool implements BufferHandler { |
|
240 |
|
241 public void setMinBufferSize(int size) { |
|
242 } |
|
243 |
|
244 @Override |
|
245 public ByteBuffer getBuffer() { |
|
246 int size = 32 * 1024; |
|
247 return ByteBuffer.allocate(size); |
|
248 } |
|
249 |
|
250 @Override |
|
251 public void returnBuffer(ByteBuffer buffer) { |
|
252 } |
|
253 } |
236 } |
254 |
237 |
255 private void writeFrame(Http2Frame frame) throws IOException { |
238 private void writeFrame(Http2Frame frame) throws IOException { |
256 ByteBufferReference[] refs = new FramesEncoder().encodeFrame(frame); |
239 ByteBufferReference[] refs = new FramesEncoder().encodeFrame(frame); |
257 //System.err.println("TestServer: Writing frame " + frame.toString()); |
240 //System.err.println("TestServer: Writing frame " + frame.toString()); |