[ 
https://issues.apache.org/jira/browse/CXF-5417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13872028#comment-13872028
 ] 

Sergey Beryozkin commented on CXF-5417:
---------------------------------------

Hi Andriy,

Ouch, of course, you are right. 

I've spotted this:
{code:java}
response.getOutputStream().print();
response.getOutputStream().flush(); 
{code}

where 'response' would be AsyncContext.getResponse().

That is supposed to throw the exception if the client has disconnected; if that 
works and the client can still get a proper response afterwards then may be we 
can settle on it. 

Otherwise I can only speculate that if we can get an access to a non-blocking 
NIO socket channel that we can detect it.

Finally, as the last resort we can indeed send a keep alive text of our choice: 
and support it out of box at CXF client level, example, if HTTPConduit or say 
JAX-RS client is asked to do so then it would open a ServerSocket which will 
accept keep alives, this socket will be closed after WebClient.close. Non-CXF 
clients would be expected to support it similarly provided the server has been 
setup to do the keep alives.

Any other ideas ? Dan, Aki, what do you think ?

Sergey


> Support optional JAX-RS 2.0 ConnectionCallback
> ----------------------------------------------
>
>                 Key: CXF-5417
>                 URL: https://issues.apache.org/jira/browse/CXF-5417
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS, Transports
>            Reporter: Sergey Beryozkin
>            Priority: Minor
>
> https://jax-rs-spec.java.net/nonav/2.0/apidocs/javax/ws/rs/container/ConnectionCallback.html
> lets JAX-RS 2.0 applications receive the notifications when a given client 
> has disconnected.
> We can probably build something on top of the Jetty-specific connector and 
> also enhance CXF Continuation API. 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to