java.lang.Object
org.htmlunit.websocket.JettyWebSocketAdapter
- All Implemented Interfaces:
WebSocketAdapter
Jetty12 based impl of the WebSocketAdapter.
To avoid conflicts with other jetty versions used by projects, we use
our own shaded version of jetty12 (https://github.com/HtmlUnit/htmlunit-websocket-client).
- Author:
- Ronald Brill
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classclassJetty12 based implementation of the WebSocket listener. -
Constructor Summary
ConstructorsConstructorDescriptionJettyWebSocketAdapter(WebClient webClient, WebSocketListener listener) Ctor. -
Method Summary
-
Constructor Details
-
JettyWebSocketAdapter
Ctor.- Parameters:
webClient- theWebClientlistener- theWebSocketListener
-
-
Method Details
-
start
Starts the client.- Specified by:
startin interfaceWebSocketAdapter- Throws:
Exception- in case of error
-
connect
Connects to the givenURI.- Specified by:
connectin interfaceWebSocketAdapter- Parameters:
url- the target url- Throws:
Exception- in case of error
-
send
Sends the provided content.- Specified by:
sendin interfaceWebSocketAdapter- Parameters:
content- the content to be sent- Throws:
IOException- in case of error
-
closeIncomingSession
public void closeIncomingSession()Close the incoming session.- Specified by:
closeIncomingSessionin interfaceWebSocketAdapter
-
closeOutgoingSession
public void closeOutgoingSession()Close the outgoing session.- Specified by:
closeOutgoingSessionin interfaceWebSocketAdapter
-
closeClient
Close the client.- Specified by:
closeClientin interfaceWebSocketAdapter- Throws:
Exception- in case of error
-