bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Socket error handling


From: Federico Montesino Pouzols
Subject: Re: Socket error handling
Date: Fri, 8 Nov 2002 11:08:24 +0100
User-agent: Mutt/1.4i

        I agree, a descriptive error string should be provided to
error() and the exception object constructors. It seems that currently
there is no check for strerror_r, so it may be necessary to add a
check for that and use strerror_r whenever possible.

        Perhaps we should add a parameter to SocketPort::disconnect to
indicate the disconnection reason. Socket::error may not be the most
adequate type, since the kind of errors that can be detected is more
related to the error codes that can be retrieved from select/poll
(ERROR, HUP, CLOSE, etc.)

On Thu, Nov 07, 2002 at 11:01:03PM +0100, Prochnow, Christian wrote:
> Hi List,
> 
> i'm wondering how one can do proper errorhandling using the throwException 
> error mode and the Socket class?
> The SockException class which gets thrown should at least contain the error 
> code which caused the throw - without it it's simply useless. 
> A textual error message retrieved from the O/S is also usefull when passing 
> error messages down to the user and should be passed on each call to 
> Socket::error().
> eg.
> error(errBindingFailed,strerror(errno);
> 
> Using the SocketPort class there should also a way to retrieve the error 
> which 
> caused the disconnect-event.
> 
> Regards,
> Christian Prochnow
> 
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]