yw_conn_open

Name

yw_conn_open -- open new connection to server

Synopsis


     #include <yw/sock.h>
   

int yw_conn_open(YwConnection *conn);

DESCRIPTION

When connection structure is allocated using yw_conn_new(3), you need to use this function in order to connect to the server. You can previously set some connection parameters using yw_set_flag(3). This function creates socket, and tries to connect it to the server. Then it tries to authenticate, and does basic connection feature negotation. Since it's quite complex, it can fail for several reasons. After you're done with this connection, you need to close it, and release YwConnection structure using yw_conn_free(3).

RETURN VALUE

The yw_conn_open() function returns 0 for success or one of the following values in case of error:

It also sets internal state of conn to returned value. It can be checked later using yw_conn_state(3). It's impossible to reuse the same connection for second yw_conn_open() call.

For more information about determing the way connection is established, please refer to yw_conn_set_flag(3).

INFO

Generated from: sysconn.c,v 1.11 2001/05/11 10:38:05 malekith Exp.