Is there a way to determine whether a call to onClose was triggered by
the client or the server?

I'm implementing a base WebSocket class, and any time a subclass
throws an exception while handling a message, I close the connection
with an error message. When this happens, the onClose method fires.

My base WebSocket is providing an onClientClose method to my
subclasses, so I'd like to know if there's an easy way to determine
whether a call to onClose was triggered by the Javascript client
closing the connection or by the Java/jetty server closing the
connection. Currently, I'm setting a flag before closing the
connection myself, but I've noticed that any error in jetty also
closes the connection and calls onClose.

Thanks in advance,
Brandon
_______________________________________________
jetty-users mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to