Hello!

On Mon, Nov 28, 2005 at 01:09:36PM +0100, Richard Nyberg wrote:
>At Sun, 27 Nov 2005 22:53:40 +0100,
>Alexander Lazic wrote:
>[...]
>> I wan't to make a nonblocking connect with libevent but i'am not sure if
>> i must make a

>> event_set(...);
>> event_add(...);

>> or not

>[...]

>If connect returns -1 with errno not set to EINPROGRESS something went
>wrong. Otherwise use event_set+event_add to wait for EV_WRITE. The event
>will trigger when the connection has succeded (or failed). I don't know
>if there's a good way to know if the connection failed other than to just
>go ahead and write and then handle errors.

        int error;
        socklen_t foo = sizeof(error);
        getsockopt(sd, SOL_SOCKET, SO_ERROR, & error, & foo);

>Good luck!

Kind regards,

Hannah.

_______________________________________________
Libevent-users mailing list
[email protected]
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to