Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Soap services, tomcat servlets, detecting dropped client connection

Reply
Thread Tools

Soap services, tomcat servlets, detecting dropped client connection

 
 
Phil Jarvis
Guest
Posts: n/a
 
      07-02-2004
I have a soap server running on Tomcat.
The client makes a request, and the server may have to spend some
nontrivial time formulating the response.

WHile the server formulates the response,
the client is killed by the user and the connection is (theoretically)
killed.

Is there a way to detect on the server side that the connection has been
dropped BEFORE any attempt to issue a response to the socket?

I want to get the servlet to cease and desist computation if the
socket is dropped, and if possible I'd like to detect it before my JDBC
transaction completes so I can abort a corresponding database transaction.

Right now I don't get any error until long after my transactions are
closed and the servlet has completed the response for transmission.

Thanks for any tips.

I'm using standard HttpServlet and JAXMservlet stuff on Tomcat 4.

(Does tomcat 5 automatically send some kind of interrupt to my servlet
when the connection is dropped? Maybe all I need to do is upgrade
servlet containers?)

Please post responses here, my email setup eats them.

--
----------

Email from unknown persons will be blocked by spam filters.
Please post replies to the new conference. Thank you.
 
Reply With Quote
 
 
 
 
Phil Jarvis
Guest
Posts: n/a
 
      07-06-2004
Any takers with some advice on this item?

Phil Jarvis wrote:
> I have a soap server running on Tomcat.
> The client makes a request, and the server may have to spend some
> nontrivial time formulating the response.
>
> WHile the server formulates the response,
> the client is killed by the user and the connection is (theoretically)
> killed.
>
> Is there a way to detect on the server side that the connection has been
> dropped BEFORE any attempt to issue a response to the socket?
>
> I want to get the servlet to cease and desist computation if the
> socket is dropped, and if possible I'd like to detect it before my JDBC
> transaction completes so I can abort a corresponding database transaction.
>
> Right now I don't get any error until long after my transactions are
> closed and the servlet has completed the response for transmission.
>
> Thanks for any tips.
>
> I'm using standard HttpServlet and JAXMservlet stuff on Tomcat 4.
>
> (Does tomcat 5 automatically send some kind of interrupt to my servlet
> when the connection is dropped? Maybe all I need to do is upgrade
> servlet containers?)
>
> Please post responses here, my email setup eats them.
>


--
----------

Email from unknown persons will be blocked by spam filters.
Please post replies to the new conference. Thank you.
 
Reply With Quote
 
 
 
 
Sudsy
Guest
Posts: n/a
 
      07-06-2004
Phil Jarvis wrote:
> Any takers with some advice on this item?


I haven't needed to try this but you might want to look into
SocketChannel and Selector. It would seem possible to register
interest in reading from the SocketChannel and if the remote
end "properly" closes the socket then the channel should show
as being readable but the read will return -1, indicating EOF.
I'd surmise that a tutorial on this sort of use of nio could
be found on the Sun site.
Again, not something I've needed so I don't have any boiler-
plate available.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
deploying the websphere SOAP client in tomcat Garg Java 2 09-01-2008 04:50 PM
SOAP Client -getting data from SOAP::Mapping::Object? Mason Brown Ruby 1 05-23-2007 03:24 AM
Security and dropped connection HowburyPete Wireless Networking 4 11-19-2004 09:04 PM
Dropped wireless connection Chris Wireless Networking 1 11-10-2004 06:51 AM
SOAP Client creation in ASP.NET using MS SOAP Toolkit Sham Ramakrishnan ASP .Net 2 07-01-2003 11:29 AM



Advertisments