void vortex_connection_shutdown ( VortexConnection connection)

Shutdown the connection provided immediately without doing BEEP session close, flagging the connection as non connected (without deallocating resources associated to the connection).

You can use this function to perform a forced connection close (without meeting BEEP requirements while closing sessions).

From a listener perspective (a connection created pasively), once the connection is closed using this function, vortex library will detect its status, removing all its references to the connection (vortex_connection_unref).

From a client perspective (the side that created the connection using vortex_connection_new) a call to vortex_connection_close after calling this function is required.

How to know if you must call to vortex_connection_close after calling to vortex_connection_shutdown? Your application must perform a call to vortex_connection_close if it issued a call to vortex_connection_new.

Example 1: Closing a connection at the client side:

1 // Call to terminate the connection right now. No reference counting
2 // is updated.
3 vortex_connection_shutdown (connection);
4 
5 // now close the connection (decreases the reference counting, that is
6 // the one assignated by vortex_connection_new) and terminates resources
7 // associated.
8 vortex_connection_close (connection);
9 
10 // NOTE: a call to vortex_connection_close, after vortex_connection_shutdow
11 // never fails.

Example 2: Closing a connection at the listener side:

1 // Call to terminate the connection right now. No reference counting
2 // is updated.
3 vortex_connection_shutdown (connection);
4 
5 // Now let the system to collect the connection since the listener
6 // do not owns a reference (he didn't create the connection by doing
7 // a vortex_connection_new but it was received).

The key of the function is that it do not updates the reference counting. The caller will still have to do all required calls to vortex_connection_unref (as much as times called to vortex_connection_ref).

Parameters
connectionThe connection to be shutted down.

References VortexConnectionForcedClose.

Referenced by vortex_external_listener_new().