bug-commoncpp
[Top][All Lists]
Advanced

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

Re: detecting broken sockets


From: Federico Montesino Pouzols
Subject: Re: detecting broken sockets
Date: Thu, 19 Sep 2002 16:33:00 +0200
User-agent: Mutt/1.4i

        Hi,

        Well, I do not know if it is exactly what you are looking for,
but ost::Socket has several methods for handling socket errors:

        * setError, which enables/disables exception throwing

        * connectError, which checks the socket status and returns the
corresponding ost::Socket::Error (this is for checking after a
connect).

        * error, which, given a ost::Socket::Error throws an exception
or simply returns the error depending on what you have set with
setError().

On Wed, Sep 18, 2002 at 03:26:36PM -0700, Alex Pavloff wrote:
> 
> Hello folks,
> 
> I've been using the UnixSocket class (which I wrote), and I'm trying to
> figure out how to handle a certain situation.  I want to test to see if the
> socket is broken in anyway, and if so, attempt a reconnect.  I'm using
> UnixStream (like TCPStream), so the good() call just checks the failbits to
> see if an error *did* occur.  
> 
> So whats the best way to do this?  Is there a std::stringbuf or some std
> function that I can use?  Is there some ost::Socket function I can call?
> (Doubt it, since the UnixSocket fits sort of strangely on top of Socket).
> Or do I write a test function and add it directly to UnixSocket?
> 
> Thanks,
> 
> Alex Pavloff - address@hidden
> Eason Technology -- www.eason.com
>  
> 
> 
> _______________________________________________
> 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]