[Vortex] closing a channel in the on_channel_created callback

Jens Alfke jens at mooseyard.com
Tue Mar 18 15:54:53 CET 2008


On 18 Mar '08, at 3:55 AM, dexter wrote:

> But.. if it is not allowed to close channel in that callback, how  
> can I
> do that?

Defer the close until sometime after the callback returns. (OS- 
dependent, but typically your thread has an event loop that supports  
timers; so set a timer to go off in 0.01 sec, which in practice means  
on the very next event loop iteration.)

> Because I don't need that channel anymore, I was just using
> this vortex_channel_new to check if the connection is still alive, so
> when I got the channel I know that the connection is ok, and I just
> close it.

Why not open the channel just once, and send a message over it to ping  
it?

—Jens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1875 bytes
Desc: not available
Url : http://lists.aspl.es/pipermail/vortex/attachments/20080318/def50281/attachment.bin 


More information about the Vortex mailing list