YCloseConnection(3) disconnects from Y server


#include <Y2/Y.h>
#include <Y2/Ylib.h>

void YCloseConnection(

        YConnection *connection,

        Boolean no_shutdown


Specifies the connection to the Y server, obtained by a call to YOpenConnection.
If True then the Y server will be left running. If False then if the original call to YOpenConnection which obtained the connection pointer started the Y server then the Y server will be shut down. However if the Y server was already running before the call to call to YOpenConnection then the Y server will not be shut down. The default and standard value is False.


The YCloseConnection function closes the connect to the Y server pointed to by connection. After calling this function, the given pointer connection should no longer be referanced.

You will not receive a YDisconnect event after calling this function, since the connection has been terminated and there is no way to receive further YEvents.


#include <stdio.h>
#include <Y2/Y.h>
#include <Y2/Ylib.h>

int main(int argc, char *argv[])

        YConnection *con = YOpenConnection(




        if(con == NULL)


        YCloseConnection(con, False);