[Vortex] How to correctly close a connection?

Robert M. Münch robert.muench at robertmuench.de
Mon Oct 6 16:15:45 CEST 2008

Hi, I have the following setup. I use vortex together with a scripting  
language. For this I have coded some high-level function in C that are  
used by the scripting language and these high-level functions call the  
vortex functions.

The script can issue things like send-file. Those calls return immediatly,  
while my functions & vortex functions do the transfer ansynchronosly.

At the moment I have a problem when the initiator (client) of a conneciton  
closes it. I get a seg-fault on the receiver (server).

So some questions:

1. On the client I call
	- vortex_connection_shutdown
	- vortex_connection_close
in this order. At the moment I know that no transfer is happening. Is this  
the correct way?

2. I want to make sure that a call to disconnect from the script hangs as  
long there is still a transfer running on the vortex side. So, blocking  
the script. How can I check if vortex channels are still in use and wait  
until I can close a connection gracefully?

3. On the server I use an on_connection_closed handler. This handler just  
sends a message to the script and returns. I expect that the server is  
than going back into the listening loop. Is this correct? The crash  
happens after the on_connection_closed handler is called.

Any help is appreciated. Thanks.

Robert M. Münch
Mobile: +49 (177) 245 2802

More information about the Vortex mailing list