Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] WebSocketListener clarification


A couple of questions about the WebSocketListener interface, which is not completely clear by reading the Javadoc.

1) Concurrent invokes
Methods are always invoked one at a time?
So, for example, onWebSocketError() is never concurrently invoked with  onWebSocketText().

onWebSocketClose and onWebSocketError are never both invoked at the end of the lifecycle of a listener. If onWebSocketError is invoked, onWebSocketClose is never invoked, right?

The first method invoked is always onWebSocketConnect?
For example, onWebSocketError is never invoked as the first operation?

So the lifecycle of a WebSocketListener is roughly as follows:

onWebSocketConnect() -> followed by
0 or more onWebSocketBinary() or onWebSocketText() (sequentiel) -> followed by
onWebSocketError or onWebSocketClose -> no listener methods is invoked after this.


Back to the top