YCloseConnection(3)

NAME

YCloseConnection - disconnects from Y server

SYNTAX

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

void YCloseConnection(
        YConnection *connection,
        Boolean no_shutdown
)

ARGUMENTS

connection
    Specifies the connection to the Y server, obtained by a call to YOpenConnection.

no_shutdown
    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.

DESCRIPTION

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 recieve a YDisconnect event after calling this function, since the connection has been terminated and there is no way to recieve further YEvents.

EXAMPLE

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

int main(int argc, char *argv[])
{
        YConnection *con = YOpenConnection(
                "/usr/sbin/starty",
                "127.0.0.1:9433"
        );
        if(con == NULL)
                return(1);

        YCloseConnection(con, False);

        return(0);
}

SEE ALSO

YOpenConnection(3) YShutdownServer(3)