Bug 54127 - WsOutbound is missing a ping method
Summary: WsOutbound is missing a ping method
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.32
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-09 20:23 UTC by Sean Winterberger
Modified: 2012-11-09 20:35 UTC (History)
0 users



Attachments
patch which adds ping functionality to WsOutbound (1.80 KB, patch)
2012-11-09 20:23 UTC, Sean Winterberger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Winterberger 2012-11-09 20:23:13 UTC
Created attachment 29577 [details]
patch which adds ping functionality to WsOutbound

WsOutbound currently lacks the ability to send a ping request to the client.

Attached patch creates a new method pong which takes in a ByteBuffer and passes the ping byte (0x09) to sendControlMessage which sets the opcode byte on the frame.  Refactored pong method to all call sendControlMessage as opposed to duplicate code. 

Added websocket.Constants import for OPCODE_PING/PONG.
Comment 1 Mark Thomas 2012-11-09 20:25:25 UTC
Comment on attachment 29577 [details]
patch which adds ping functionality to WsOutbound

Fix MIME type. Set patch flag.
Comment 2 Mark Thomas 2012-11-09 20:35:42 UTC
Many thanks for the patch. I had to clean it up a little:
- tabs -> 4 spaces
- remove trailing white space
- remove unnecessary (and in wrong order) import

Running the build with Checkstyle enabled would have caught all of the above. That said, they were trivial to fix.

The patch has been applied to trunk and 7.0.x and will be include in 7.0.33 onwards. Thanks again.