test/jdk/java/net/httpclient/http2/server/Http2TestServer.java
branchhttp-client-branch
changeset 56205 f4c9c5920141
parent 56204 e5d0c20217a3
child 56210 efa5db108669
equal deleted inserted replaced
56204:e5d0c20217a3 56205:f4c9c5920141
   225                     Socket socket = server.accept();
   225                     Socket socket = server.accept();
   226                     Http2TestServerConnection c = null;
   226                     Http2TestServerConnection c = null;
   227                     InetSocketAddress addr = null;
   227                     InetSocketAddress addr = null;
   228                     try {
   228                     try {
   229                         addr = (InetSocketAddress) socket.getRemoteSocketAddress();
   229                         addr = (InetSocketAddress) socket.getRemoteSocketAddress();
   230                         c = new Http2TestServerConnection(this, socket, exchangeSupplier);
   230                         c = createConnection(this, socket, exchangeSupplier);
   231                         putConnection(addr, c);
   231                         putConnection(addr, c);
   232                         c.run();
   232                         c.run();
   233                     } catch (Throwable e) {
   233                     } catch (Throwable e) {
   234                         // we should not reach here, but if we do
   234                         // we should not reach here, but if we do
   235                         // the connection might not have been closed
   235                         // the connection might not have been closed
   252                 }
   252                 }
   253             }
   253             }
   254         });
   254         });
   255     }
   255     }
   256 
   256 
       
   257     protected Http2TestServerConnection createConnection(Http2TestServer http2TestServer,
       
   258                                                          Socket socket,
       
   259                                                          Http2TestExchangeSupplier exchangeSupplier)
       
   260             throws IOException {
       
   261         return new Http2TestServerConnection(http2TestServer, socket, exchangeSupplier);
       
   262     }
       
   263 
   257     @Override
   264     @Override
   258     public void close() throws Exception {
   265     public void close() throws Exception {
   259         stop();
   266         stop();
   260     }
   267     }
   261 }
   268 }