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).
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:
// Call to terminate the connection right now. No reference counting // is updated. vortex_connection_shutdown (connection); // now close the connection (decreases the reference counting, that is // the one assignated by vortex_connection_new) and terminates resources // associated. vortex_connection_close (connection); // NOTE: a call to vortex_connection_close, after vortex_connection_shutdow // never fails.
Example 2: Closing a connection at the listener side:
// Call to terminate the connection right now. No reference counting // is updated. vortex_connection_shutdown (connection); // Now let the system to collect the connection since the listener // do not owns a reference (he didn't create the connection by doing // 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).