----- Original Message -----
From: "Noel J. Bergman" <[EMAIL PROTECTED]>
> > Shouldn't the exception be logged even if the socket is null ?
>
> No. NNTP clients often leave sockets open for extending periods of time
> without closing or using them. We time them out regularly, as some of our
> users have noticed. We log the fact that we timed out the socket.
> Gratuitiously forcing and logging an exception that we would be
responsible
> for causing is a poor practice.
>
Is there any chance any exception, say a runtime exception is thrown and the
socket is null ? If it is than that exception would not be logged.
> > It is good to check for socket != null, but
> > try {
> > doQUIT(null);
> > } catch(Throwable t) { }
> > Would be effective even if it is socket is null.
>
> Excuse me? How precisely are you proposing to send a message through a
> socket whose instance is null? Please define "effective."
QUIT would fail if socket is null and be silently ignored courtesy the catch
all clause. If the socket is not null, QUIT would be sent. There is a small
overhead in Exception object creation in this rarely invoked code path.
However, checking for socket != null is fine. Avoids going down a path that
would throw an exception.
Harmeet
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>