First, thanks so much for such a fantastic product.
Jetty has been my go to web server for a *really* long time now and it
never disappoints.

I have recently created a web app that uses WebSockets as the primary
communication with its clients and it all works well. But we occasionally
get the following WebSocketException

org.eclipse.jetty.websocket.api.WebSocketException: RemoteEndpoint
unavailable, current state [CLOSING], expecting [OPEN or CONNECTED]
at
org.eclipse.jetty.websocket.common.WebSocketSession.getRemote(WebSocketSession.java:252)
at au.com.xandar.obfuscated.cm.a(SourceFile:41)

when we are in the middle of processing an incoming request and attempt to
get the remote endpoint in order to send a message back.

We have tried to mitigate by checking Session#isOpen but it uses a
different condition to determine whether the Session is open than what
#getRemote does, and it would also suffer from a potential race condition.

Other than catching the unchecked WebSocketException on #getRemote (which
seems wrong) is there a definitive way to determine whether I can send to
the client?
Wouldn't it perhaps be better if #getRemote returned null if the remote end
point was no longer available?


William

ᐧ
_______________________________________________
jetty-users mailing list
jetty-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to