>>> "Christopher K. St. John" <[EMAIL PROTECTED]> 02-Nov-00 3:07:02 PM
>>>

>> Yes you do. A ServletContext lifecycle event can take
>> your Socket down cleanly.

>You can detect the destroy(), but you don't have any
>control over when/whether it happens.

That's true but you just synchronize the Socket handling stuff and
ask the Socket to be closed in the ServletContext destruction event.


>if the thread and socket still exist, all the webapps's other
>resources will have gone away [2]

The event occurs BEFORE a webapp is unloaded - the spec says:

  notify a listener that "the ServletContext is about to be
shutdown"



>[1] "Awkward to handle properly" == "Nobody will bother
>to handle it properly" Is it legal to block in destroy()
>until the socket conversation is over? Presumbably not.

Yes... it's legal. That's what it's for. Think about SQL/JDBC which
was much in vogue when Servlet destory's were first being used. In
that case the JDBC Connection (a Socket generally) has to be cleaned
up... it might be in the middle of something so you synchronize it.



Nic

PS Chris and I would like to apologise for this rash attempt to
discuss something usefull on Servlet-Interest. Normal service will be
resumed as soon as possible /8->

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to