> Hi,
> 
> This fixes a problem where the listener methods of a WebSocket client were 
> being invoked by the Selector manager thread, which is problematic, because 
> if the implementation of any of these methods tries to do any blocking work, 
> this impacts other http activity, and if the blocking work is a http client 
> call, then a hang can result. The fix makes the HttpClient's executor 
> available to WebSocketImpl and that is used to offload the listener 
> invocations.
> 
> The fix also adds a more comprehensive test framework for WebSockets (in 
> WebSocketServer). Up to now we just had a limited server side in the tests 
> that can only do the handshake. This change adds an API and implementation 
> for server's to receive websocket messages and send replies back to clients. 
> To implement this, the server hooks into WebSocket's Frame, MessageEncoder 
> and MessageDecoder classes. Therefore, the implementations of these classes 
> had to be modified to allow for the encoding of server generated messages and 
> the decoding of client generated messages. The only difference between client 
> and server in this respect relates to payload masking which is only done for 
> messages sent from client to server.
> 
> There's a couple of warts that I wasn't sure what to do with. 1) There is 
> already a copy of the Frame implementation class in the test hierarchy. I 
> presume this is used by other tests, but that implementation is not used by 
> this change. 2) The WebSocketServer is based on the existing 
> DummyWebSocketServer class which is used by other tests. I can't see any easy 
> way to refactor/combine these implementations.
> 
> Thanks,
> 
> Michael.

Michael McMahon has updated the pull request with a new target base due to a 
merge or a rebase. The incremental webrev excludes the unrelated changes 
brought in by the merge/rebase. The pull request contains five additional 
commits since the last revision:

 - Merge branch 'master' into websocket
 - fixed small error in previous update. Doesn't affect test, but just looks odd
 - changed AtomicReference to CompletableFuture
 - add comments to test
 - fix implementation plus some extra websocket test work

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4506/files
  - new: https://git.openjdk.java.net/jdk/pull/4506/files/4a8cb7e6..8f279da9

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4506&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4506&range=02-03

  Stats: 17671 lines in 424 files changed: 13871 ins; 1918 del; 1882 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4506.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4506/head:pull/4506

PR: https://git.openjdk.java.net/jdk/pull/4506

Reply via email to