tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Hanik \(mailing lists\)" <devli...@hanik.com>
Subject RE: non blocking Websockets?
Date Thu, 31 May 2012 18:12:24 GMT
You can achieve that right now. Use the NIO connector, And then set up the
write buffer:

<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
           socket.txBufSize="set socket buffer size in bytes here"
           
The only "blocking" aspect the connector actually has is to put the data in
the OS TCP write buffer. After that, the OS delivers it asynchronously.
So if you size this buffer correctly, you will achieve complete non blocking
data

Filip


> -----Original Message-----
> From: Christian Finckler [mailto:christian.finckler@gmx.de]
> Sent: Thursday, May 31, 2012 11:45 AM
> To: Tomcat Users List
> Subject: Re: non blocking Websockets?
> 
> 
> 
> Am 31.05.2012 11:09, schrieb Mark Thomas:
> > On 31/05/2012 10:02, Christian Finckler wrote:
> >> Hello,
> >> as far I understood, the websocket implementation of tomcat is using
> one
> >> thread per client.
> >> Is there also a possibility to configure it to use non blocking IO?
> > No. That has not yet been implemented. It shouldn't be too hard
> provided
> > that non-blocking is used between messages and blocking is used during
> > messages. Obviously, the BIO connector will always use blocking.
> >
> > Mark
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> 
> Ok, if that is so easy, it should be done. I am developing an online
> game, in which the player dont send messages very often (max: ten
> messages per minute), but is is very important to get the messages of
> other players very fast. Thats why I want to use websockets. But now it
> would be sad, if I need multiple tomcat instances only for connection
> handling although the process handling itself is not very complicated
> (cpu and memory intensive).
> 
> Thank you,
> Chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org



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


Mime
View raw message