Disabling Naggle's algorithm / Setting tcpNoDelay programatically for web sockets

2015-06-24 Thread Ganesh Bms
Hi,

As per tomcat's performance tuning doc, 'tcpNoDelay' can be
enabled/disabled at connector level.
Is there a programmatic way to set 'tcpNoDelay' to true for web socket
connections ? I am using tomcat's proprietary web socket APIs in my
application.

I have gone though the API documentation of tomcat's proprietary web socket
implementation, I didn't see any API which allows application to override
the 'tcpNoDelay' value.

As per doc for writeTextMessage(CharBuffer msgCb) of 'WsOutbound', for
each write, tomcat flushes the socket buffer and sends the new frame with
the buffer passed. Does that mean, flushing of socket buffer gives the same
effect of disabling naggle's algorithm ?

Thanks,
Ganesh


Re: WebSocket: Special character escaping

2015-06-02 Thread Ganesh Bms
Thanks Mark. Sample web socket chat helped to identify the problem. In
fact, problem was there in one of third-party lib I used and also, in log4j
config. The log4j was configured with non-utf encoding scheme. That's why
raw web socket messages were getting printed wrongly in log file. I solved
the issue by putting UTF-8 escaping to special characters.

Regards,
Ganesh

On Wed, May 13, 2015 at 4:27 PM, Mark Thomas ma...@apache.org wrote:

 On 13/05/2015 11:44, Ganesh Bms wrote:
  Sorry .. correction to line:
 
  The text that my client sends is Test701á. Server received is
 SIP701?.
 
  Actual: The text that my client sends is Test701á. Server received is
  Test701?.

 Lots of places this could go wrong. You need to make sure that
 everything is using UTF-8 everywhere.

 I'd check these first:
 - The client is sending the text encoding using UTF-8
 - Your server application is displaying the received String using UTF-8

 You can see if Tomcat handles this correctly by using the WebSocket chat
 example and sending special characters.

 Mark

 
  On Wed, May 13, 2015 at 3:33 PM, Ganesh Bms gbmsat...@gmail.com wrote:
 
  Hi,
 
  I have written a web socket server using web socket API(JSR-356) and
 which
  runs on tomcat version 7.0.56.
  My test client sends some text which has some special characters over
 web
  socket connection to my server. the problem is that server is not
 getting
  the client's text as it is. the special character got modified to ?.
 
  The text that my client sends is Test701á. Server received is
 SIP701?.
  At server, I have just attached Text message handler to web socket
 session.
 
  This works fine with tomcat version 7.0.55.
 
  Please let me know if i am missing something here.
 
  Thank you,
  ganesh
 
 


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




WebSocket: Special character escaping

2015-05-13 Thread Ganesh Bms
Hi,

I have written a web socket server using web socket API(JSR-356) and which
runs on tomcat version 7.0.56.
My test client sends some text which has some special characters over web
socket connection to my server. the problem is that server is not getting
the client's text as it is. the special character got modified to ?.

The text that my client sends is Test701á. Server received is SIP701?.
At server, I have just attached Text message handler to web socket session.

This works fine with tomcat version 7.0.55.

Please let me know if i am missing something here.

Thank you,
ganesh


Re: WebSocket: Special character escaping

2015-05-13 Thread Ganesh Bms
Sorry .. correction to line:

The text that my client sends is Test701á. Server received is SIP701?.

Actual: The text that my client sends is Test701á. Server received is
Test701?.

On Wed, May 13, 2015 at 3:33 PM, Ganesh Bms gbmsat...@gmail.com wrote:

 Hi,

 I have written a web socket server using web socket API(JSR-356) and which
 runs on tomcat version 7.0.56.
 My test client sends some text which has some special characters over web
 socket connection to my server. the problem is that server is not getting
 the client's text as it is. the special character got modified to ?.

 The text that my client sends is Test701á. Server received is SIP701?.
 At server, I have just attached Text message handler to web socket session.

 This works fine with tomcat version 7.0.55.

 Please let me know if i am missing something here.

 Thank you,
 ganesh



Re: How does Tomcat identify web socket endpoint in a war?

2015-04-24 Thread Ganesh Bms
I think, yes. That's why I went for programmatic endpoint.

On Fri, Apr 24, 2015 at 4:55 PM, Thusitha Thilina Dayaratne 
thusithathil...@gmail.com wrote:

 Hi,

 Could someone tell me how does Tomcat identify the websocket endpoints in
 .war file?
 Does it scan all the classes and looks for annotations?

 Thanks
 Best Regards

 --



Fwd: Web socket connection getting dropped

2015-04-13 Thread Ganesh Bms
Hi folks,

I am facing an issue with tomcat's proprietary web socket API. I have
implemented web socket server application using tomcat's proprietary APIs.
The web socket connections are getting dropped after 2-3 hours of idle. The
tomcat is not even notifying my app about this disconnection.

The exception I am seeing in tomcat's catalina logs is as below:

java.net.SocketException: Connection timed out
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
at sun.security.ssl.OutputRecord.writeBuffer(OutputRecord.java:377)
at sun.security.ssl.OutputRecord.write(OutputRecord.java:363)
at
sun.security.ssl.SSLSocketImpl.writeRecordInternal(SSLSocketImpl.java:830)
at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:801)
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
at
org.apache.coyote.http11.upgrade.UpgradeBioProcessor.write(UpgradeBioProcessor.java:67)
at
org.apache.coyote.http11.upgrade.UpgradeOutbound.write(UpgradeOutbound.java:49)
at
org.apache.catalina.websocket.WsOutbound.doWriteBytes(WsOutbound.java:499)
at
org.apache.catalina.websocket.WsOutbound.doWriteText(WsOutbound.java:529)
at
org.apache.catalina.websocket.WsOutbound.writeTextMessage(WsOutbound.java:221)

Please help me in identifying the reason behind this behaviour.

Thanks,
Ganesh