Re: stop tcp connect

DINH Viet Hoa <[email protected]> Wed, 19 Apr 2006 16:31:45 +0200
Newsgroups gmane.mail.libetpan.user
Message-ID <etPan.444649d1.6222230c.2011@utopia>
Marko Ivancic wrote :

> Is  there any easy way to cancel the socket connection in code:
> 
> mailstorage_tools.c  -> method : tcp_connect(char * server, uint16_t port)
> 
> I read man for connect and it say's that it can be done with signals but 
> I can not figure out how to do it in libetpan.
> I'll be wary appreciate if someon would give me an example on how to do it.

using signal would be a bad hack.

You'd better wait the timeout to come.
Then, connection needs to be done in a thread.
But you're free to write a non-blocking connection so that you can 
cancel easily the socket connection.

-- 
DINH V. Hoa,

"C'est vraiment des cons les gens qui savent pas écrire français." -- sunZ
signature.asc (application/pgp-signature, 0 B)