Man Linux: Main Page and Category List

NAME

       YGetServerStats - Y server statistics retrieving

SYNTAX

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

       int YGetServerStats(
               YConnection *connection,
               YEventServerStats *buf
       )

ARGUMENTS

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

       buf    Specifies a pointer to the buffer where the Y server  statistics
              will  be  placed.   See  YEventServerStats  for more information
              about this structure.

DESCRIPTION

       The YGetServerStats function retrieves statistics about  the  Y  server
       including  version  and  load. There may be additional members added to
       the YEventServerStats structure in the future.

RETURN VALUE

       The YGetServerStats function returns 0 on success and -1 on error.

EXAMPLE

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

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

               if(YGetServerStats(con, &buf))
                       printf("Failed.\n");
               else
                       printf("Success.\n");

               YCloseConnection(con, False);

               return(0);
       }

SEE ALSO

       YEventServerStats(3) YGetAudioStats(3)