tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51181] Add support for Web Sockets
Date Tue, 10 Jan 2012 09:35:09 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51181

--- Comment #25 from Pid <bugzilla@pidster.com> 2012-01-10 09:35:09 UTC ---

>   // WebSocket event processor
>   public void event(WebSocketEvent event) throws IOException, ServletException
> {
>     WebSocketServletRequest request = event.getHttpServletRequest();
>     WebSocketServletResponse response = event.getHttpServletResponse();
>     // initial connection
>     if (event.getEventType() == WebSocketEvent.EventType.BEGIN) {
>       ...
>     }
>     // 
>     if (event.getEventType() == WebSocketEvent.EventType.MESSAGE) {
>       // Get message
>       WebSocketMessage inboundMessage = request.getMessage();
>       // Send message back to the client
>       response.sendMessage(new WebSocketMessage(...));

The server end probably also needs to be able to handle the receipt/issue of a
WebSocketFrame (e.g. PING/PONG frames). It's possible to send a CLOSE event in
between other frames and you might want to clean up before shutdown.

Sidenote: I think a Jetty & Tomcat collaboration would be pragmatic.

IMHO extending javax.servlet.http.WebSocketServlet would be a good final
outcome.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message