[jetty-dev] WebSocket + Async Read/Write

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-dev] WebSocket + Async Read/Write

Hiram Chirino
Hi are there any examples of how to use the Jetty websocket APIs with async reads and writes.  Specifically, I'd like to suspend/resume socket reading and I'd like be able to do non-blocking writes.

--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Joakim Erdfelt-9
WebSocket read/write on the server side is done within the context of the jetty IO framework, and is async if you use the NIO http connectors on jetty.
It is a bit influenced, however, by how proper the websocket framing is from the client, a bad/incomplete frame has in some edge cases (websocket extensions) can cause limited blocking (but those bugs are being squashed as we discover them)

--
Joakim Erdfelt

(the people behind jetty and cometd)



On Mon, Feb 13, 2012 at 1:17 PM, Hiram Chirino <[hidden email]> wrote:
Hi are there any examples of how to use the Jetty websocket APIs with async reads and writes.  Specifically, I'd like to suspend/resume socket reading and I'd like be able to do non-blocking writes.

--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Hiram Chirino
So is there an example?

On Mon, Feb 13, 2012 at 3:24 PM, Joakim Erdfelt <[hidden email]> wrote:
WebSocket read/write on the server side is done within the context of the jetty IO framework, and is async if you use the NIO http connectors on jetty.
It is a bit influenced, however, by how proper the websocket framing is from the client, a bad/incomplete frame has in some edge cases (websocket extensions) can cause limited blocking (but those bugs are being squashed as we discover them)

--
Joakim Erdfelt

(the people behind jetty and cometd)



On Mon, Feb 13, 2012 at 1:17 PM, Hiram Chirino <[hidden email]> wrote:
Hi are there any examples of how to use the Jetty websocket APIs with async reads and writes.  Specifically, I'd like to suspend/resume socket reading and I'd like be able to do non-blocking writes.

--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev




--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Jesse McConnell
I suspect the best easily accessible example would be something in cometd, guessing http://svn.cometd.org/trunk/cometd-java/cometd-websocket-jetty/

cheers,
jesse

--
jesse mcconnell
[hidden email]


On Mon, Feb 13, 2012 at 14:41, Hiram Chirino <[hidden email]> wrote:
So is there an example?


On Mon, Feb 13, 2012 at 3:24 PM, Joakim Erdfelt <[hidden email]> wrote:
WebSocket read/write on the server side is done within the context of the jetty IO framework, and is async if you use the NIO http connectors on jetty.
It is a bit influenced, however, by how proper the websocket framing is from the client, a bad/incomplete frame has in some edge cases (websocket extensions) can cause limited blocking (but those bugs are being squashed as we discover them)

--
Joakim Erdfelt

(the people behind jetty and cometd)



On Mon, Feb 13, 2012 at 1:17 PM, Hiram Chirino <[hidden email]> wrote:
Hi are there any examples of how to use the Jetty websocket APIs with async reads and writes.  Specifically, I'd like to suspend/resume socket reading and I'd like be able to do non-blocking writes.

--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev




--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Hiram Chirino
Hi Jesse,

I don't see in that example where either socket reading is suspended or socket writing is non-blocking.  How about this question, which apis should I use to:

* suspend socket reads
* resume read
* do a non-blocking write and how do I know when the write completes (so I can resume doing more writes).

On Mon, Feb 13, 2012 at 4:35 PM, Jesse McConnell <[hidden email]> wrote:
I suspect the best easily accessible example would be something in cometd, guessing http://svn.cometd.org/trunk/cometd-java/cometd-websocket-jetty/

cheers,
jesse

--
jesse mcconnell
[hidden email]



On Mon, Feb 13, 2012 at 14:41, Hiram Chirino <[hidden email]> wrote:
So is there an example?


On Mon, Feb 13, 2012 at 3:24 PM, Joakim Erdfelt <[hidden email]> wrote:
WebSocket read/write on the server side is done within the context of the jetty IO framework, and is async if you use the NIO http connectors on jetty.
It is a bit influenced, however, by how proper the websocket framing is from the client, a bad/incomplete frame has in some edge cases (websocket extensions) can cause limited blocking (but those bugs are being squashed as we discover them)

--
Joakim Erdfelt

(the people behind jetty and cometd)



On Mon, Feb 13, 2012 at 1:17 PM, Hiram Chirino <[hidden email]> wrote:
Hi are there any examples of how to use the Jetty websocket APIs with async reads and writes.  Specifically, I'd like to suspend/resume socket reading and I'd like be able to do non-blocking writes.

--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev




--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev




--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Joakim Erdfelt-9
WebSocket API is event / frame driven, you don't have access to the raw streams, so you don't have to worry about the blocking / non-blocking nature.

You create a WebSocket implementation object, wire it up to the WebSocketServlet.<a href="http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/websocket/WebSocketFactory.Acceptor.html#doWebSocketConnect(javax.servlet.http.HttpServletRequest, java.lang.String)">doWebSocketConnect() and messages (text & binary) and frames are delivered to you.
If you want to write text or buffer arrays to the other side you use the WebSocket.Connection object (passed to you in the onOpen() event) to do that, but those are also in the context of websocket messages.

An example (a simple echo websocket) is here.

--
Joakim Erdfelt

(the people behind jetty and cometd)



On Mon, Feb 13, 2012 at 2:44 PM, Hiram Chirino <[hidden email]> wrote:
Hi Jesse,

I don't see in that example where either socket reading is suspended or socket writing is non-blocking.  How about this question, which apis should I use to:

* suspend socket reads
* resume read
* do a non-blocking write and how do I know when the write completes (so I can resume doing more writes).

On Mon, Feb 13, 2012 at 4:35 PM, Jesse McConnell <[hidden email]> wrote:
I suspect the best easily accessible example would be something in cometd, guessing http://svn.cometd.org/trunk/cometd-java/cometd-websocket-jetty/

cheers,
jesse

--
jesse mcconnell
[hidden email]



On Mon, Feb 13, 2012 at 14:41, Hiram Chirino <[hidden email]> wrote:
So is there an example?


On Mon, Feb 13, 2012 at 3:24 PM, Joakim Erdfelt <[hidden email]> wrote:
WebSocket read/write on the server side is done within the context of the jetty IO framework, and is async if you use the NIO http connectors on jetty.
It is a bit influenced, however, by how proper the websocket framing is from the client, a bad/incomplete frame has in some edge cases (websocket extensions) can cause limited blocking (but those bugs are being squashed as we discover them)

--
Joakim Erdfelt

(the people behind jetty and cometd)



On Mon, Feb 13, 2012 at 1:17 PM, Hiram Chirino <[hidden email]> wrote:
Hi are there any examples of how to use the Jetty websocket APIs with async reads and writes.  Specifically, I'd like to suspend/resume socket reading and I'd like be able to do non-blocking writes.

--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev




--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev




--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Simone Bordet-2
In reply to this post by Hiram Chirino
Hi Hiram !

On Mon, Feb 13, 2012 at 22:44, Hiram Chirino <[hidden email]> wrote:
>
> Hi Jesse,
>
> I don't see in that example where either socket reading is suspended or socket writing is non-blocking.  How about this question, which apis should I use to:
>
> * suspend socket reads
> * resume read
> * do a non-blocking write and how do I know when the write completes (so I can resume doing more writes).

The current API for WebSocket offers blocking writes only. While under
the covers Jetty will do non-blocking writes, the application thread
will be blocked until the application data is fully written.
We may consider a non-blocking API for applications though (of course
a blocking API is way simpler for web applications, but *your* kind of
application is not common, I guess ;).

As for suspend/resume reads I am not sure what you mean. Can you
sketch what you would like to do ?

The 2 most used interfaces for reading are WebSocket.OnTextMessage and
WebSocket.OnBinaryMessage. Both will coalesce websocket frames until a
final frame is received, then invoke the application.
In order to avoid infinite data, the max text/binary message size can
be configured.

If you want to go deeper, you can implement WebSocket.OnFrame.

TCP backpressure can be done only via slow readers (implementations of
the interfaces above): we do not offer an API to disable reads. The
parser will aggressively try to read as much as it can and notify the
application, so if the application does nothing the parser will read
more (no way to tell the parser to not read from the socket).

As I said, the API was designed for simple usage, targeted to servlet
developers that want to dive into WebSocket.

If you have a different use case (which I can imagine - but better if
you explain it rather than me guessing), we'd love to hear.

Cheers,

Simon
--
http://cometd.org
http://intalio.com
http://bordet.blogspot.com
----
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Hiram Chirino
In reply to this post by Joakim Erdfelt-9
Hi Joakim,

On Mon, Feb 13, 2012 at 5:14 PM, Joakim Erdfelt <[hidden email]> wrote:
WebSocket API is event / frame driven, you don't have access to the raw streams, so you don't have to worry about the blocking / non-blocking nature.

You create a WebSocket implementation object, wire it up to the WebSocketServlet.doWebSocketConnect() and messages (text & binary) and frames are delivered to you.
If you want to write text or buffer arrays to the other side you use the WebSocket.Connection object (passed to you in the onOpen() event) to do that, but those are also in the context of websocket messages.


Imagine your implementing a websocket proxy using some kinda of async websocket client.  When onMessage gets called you call the async websocket client's send method, it might let you know that the write could not complete (perhaps the network is congested). At this point, it would be best if I could as Jetty to suspend calling 'onMessage' until that client write call completes.  When it does complete, I'll un-suspend and that I can continue to proxy more data.

The converse is also handy.  The websocket client will be receiving data from the remote and that I would be sending to jetty to forward on the web browser.  If the connection between jetty and the web browser is slow, I'd rather the thread not get tied up waiting to transmit data.  I'd rather get an indication that the write call did not complete and have some sort of callback when it does complete so that I can resumed proxying more data to it.

--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Hiram Chirino
In reply to this post by Simone Bordet-2

On Mon, Feb 13, 2012 at 5:18 PM, Simone Bordet <[hidden email]> wrote:
Hi Hiram !


Hi Simone!

 
The current API for WebSocket offers blocking writes only. While under
the covers Jetty will do non-blocking writes, the application thread
will be blocked until the application data is fully written.

:-(
 
We may consider a non-blocking API for applications though (of course
a blocking API is way simpler for web applications, but *your* kind of
application is not common, I guess ;).

As for suspend/resume reads I am not sure what you mean. Can you
sketch what you would like to do ?


Well what would be ideal for me is having a connection.suspend()
connection.resume() call which suspends or resumes further onMessage()
calls.
 
The 2 most used interfaces for reading are WebSocket.OnTextMessage and
WebSocket.OnBinaryMessage. Both will coalesce websocket frames until a
final frame is received, then invoke the application.
In order to avoid infinite data, the max text/binary message size can
be configured.

If you want to go deeper, you can implement WebSocket.OnFrame.


No I think you guys framing everything is just fine. 
 
TCP backpressure can be done only via slow readers (implementations of
the interfaces above): we do not offer an API to disable reads. The
parser will aggressively try to read as much as it can and notify the
application, so if the application does nothing the parser will read
more (no way to tell the parser to not read from the socket).

As I said, the API was designed for simple usage, targeted to servlet
developers that want to dive into WebSocket.

Considering that the Servlet 3.0 spec has some async processing support I was hoping some of this would be making it's way into the WebSocket apis too.
 

If you have a different use case (which I can imagine - but better if
you explain it rather than me guessing), we'd love to hear.


My use case is implementing STOMP a messaging protocol over WebSockets for the Apollo messaging server.  Apollo uses a strict async thread model (fixes size thread poll, so you CAN'T ever do a blocking call).  Right now I've lots of extra blocking threads when processing WebSockets connection and it would be nice if I could eliminate those.

But since that's kinda of a complex scenario, the WebSocket proxing scenario works just as well and is something what would be cool if I could see an example of.  Where even if you have congested networks on either side of the proxy, you don't have threads blocked waiting to do writes.
 
Cheers,

Simon
--
http://cometd.org
http://intalio.com
http://bordet.blogspot.com
----
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Hiram Chirino


On Mon, Feb 13, 2012 at 5:58 PM, Hiram Chirino <[hidden email]> wrote:

As for suspend/resume reads I am not sure what you mean. Can you
sketch what you would like to do ?


Well what would be ideal for me is having a connection.suspend()
connection.resume() call which suspends or resumes further onMessage()
calls.
 

Oh yeah and for the send side, what would work is if you have a non-blocking version of connection.sendMessage(..., Runnable onComplete) which just appends a Runnable object to the end of the call.  Calling that should just buffer any data that does not fit in the socket write, and once the socket write does finally complete the onComplete runnable should get called.

--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Simone Bordet-2
Hi,

On Tue, Feb 14, 2012 at 00:03, Hiram Chirino <[hidden email]> wrote:
>
> Oh yeah and for the send side, what would work is if you have a non-blocking version of connection.sendMessage(..., Runnable onComplete) which just appends a Runnable object to the end of the call.  Calling that should just buffer any data that does not fit in the socket write, and once the socket write does finally complete the onComplete runnable should get called.
>

Sure, this is pretty much like JDK 7's Async IO.
It's a pain to program (anonymous classes all over, non sequential
program flow, etc.), but we can support it.
Can you please file a Bugzilla about ?
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Jetty

For the read side, perhaps I was unclear. If the sender is slow, then
we will read as much as we can non blocking, and parse that.
If it's an incomplete frame, we buffer that and do not call the
application, and we release the thread, NIO style.
When more data is available, we read more, parse more, and if the
frame is now complete we call the application.
So if the application is not blocking, reading is already asynchronous
in the NIO sense in Jetty: no threads blocked, etc.

What an application cannot do is to tell Jetty to stop reading.
If the application is notified about a websocket frame, there is no
way for the application to tell Jetty to not read more if there is
data available.
I doubt this is a problem for you, but voice back if it is.

So I am guessing that with JDK7's AIO style of writes for websocket,
you should be good ?

Simon
--
http://cometd.org
http://intalio.com
http://bordet.blogspot.com
----
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Hiram Chirino
Yeah, I have to be able to tell jetty to stop reading data.  If the place I'm sending the data to not accepting any more, and I can't tell jetty to stop sending me data, and I can't block, then I have to buffer it in memory and that solution does not work too well :)

AIO style writes would be good. But I still need to be able to suspend receiving data.

On Tue, Feb 14, 2012 at 9:16 AM, Simone Bordet <[hidden email]> wrote:
Hi,

On Tue, Feb 14, 2012 at 00:03, Hiram Chirino <[hidden email]> wrote:
>
> Oh yeah and for the send side, what would work is if you have a non-blocking version of connection.sendMessage(..., Runnable onComplete) which just appends a Runnable object to the end of the call.  Calling that should just buffer any data that does not fit in the socket write, and once the socket write does finally complete the onComplete runnable should get called.
>

Sure, this is pretty much like JDK 7's Async IO.
It's a pain to program (anonymous classes all over, non sequential
program flow, etc.), but we can support it.
Can you please file a Bugzilla about ?
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Jetty

For the read side, perhaps I was unclear. If the sender is slow, then
we will read as much as we can non blocking, and parse that.
If it's an incomplete frame, we buffer that and do not call the
application, and we release the thread, NIO style.
When more data is available, we read more, parse more, and if the
frame is now complete we call the application.
So if the application is not blocking, reading is already asynchronous
in the NIO sense in Jetty: no threads blocked, etc.

What an application cannot do is to tell Jetty to stop reading.
If the application is notified about a websocket frame, there is no
way for the application to tell Jetty to not read more if there is
data available.
I doubt this is a problem for you, but voice back if it is.

So I am guessing that with JDK7's AIO style of writes for websocket,
you should be good ?

Simon
--
http://cometd.org
http://intalio.com
http://bordet.blogspot.com
----
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev



--

Hiram Chirino

Software Fellow | FuseSource Corp.

[hidden email] | fusesource.com

skype: hiramchirino | twitter: @hiramchirino

blog: Hiram Chirino's Bit Mojo





_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] WebSocket + Async Read/Write

Simone Bordet-2
Hi,

On Thu, Feb 16, 2012 at 21:53, Hiram Chirino <[hidden email]> wrote:
>
> Yeah, I have to be able to tell jetty to stop reading data.  If the place I'm sending the data to not accepting any more, and I can't tell jetty to stop sending me data, and I can't block, then I have to buffer it in memory and that solution does not work too well :)
>
> AIO style writes would be good. But I still need to be able to suspend receiving data.

I understand. This is currently not available in Jetty 7 and 8 (well,
unless replacing some hardcore bit of Jetty), but we're working on a
rewrite for Jetty 9, and we may consider this feature to be accessible
from aplications.

Thanks!

Simon
--
http://cometd.org
http://intalio.com
http://bordet.blogspot.com
----
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev