You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Steffen Heil (Mailinglisten)" <li...@steffen-heil.de> on 2015/09/06 22:33:06 UTC

AW: AW: WebSocket asynchronous reads

Hi


> > Which means I have to either buffer all incoming messages until I am
> > ready to process them (might occupy lots of memory) or I have to drop
> > them. Both is not really ideal.
> I'm largely ignorant of the asynchronous world, but I do have a question about what you're asking. Are you really asking if Tomcat can
> buffer all that data for you (which might occupy lots of memory) until you are ready to accept it? It seems like if you aren't comfortable
> with dropping the data on the floor, then it's your responsibility to accept the data and deal with it yourself, right?

No.
I am asking tomcat not to read data from the socket, if the app is not ready to receive it in the first place.
The data will then stay in the os inbound buffers and fill up the receive window, so the *sender* will be blocked eventually.
TCP allows the sender to know, when the receiver cannot handle more data right away, just the websocket api cannot.

Regards,
  Steffen