YOpenConnection - connect to Y server
#include <Y2/Y.h>
#include <Y2/Ylib.h>
YConnection *YOpenConnection(
const char *start_arg,
const char *con_arg
)
The YOpenConnection opens a new connection to the Y server.
The YOpenConnection returns a YConnection pointer that serves as the connection to the Y server and that contains all the information about that Y server. It can also return NULL if it failed to start the Y server (as needed or requested) and/or connect to it.
#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);
YCloseConnection(3) YShutdownServer(3)