Replace 'connexion' with 'connection' in English contexts
[networkupstools/kirr.git] / docs / man / upscli_connect.txt
blobd493dd06ad8393f8e35b83f8796ad13196762fdf
1 UPSCLI_CONNECT(3)
2 =================
4 NAME
5 ----
7 upscli_connect - Open a connection to a NUT upsd
9 SYNOPSIS
10 --------
12  #include <upsclient.h>
14  int upscli_connect(UPSCONN_t *ups, const char *host, int port, int flags);
16 DESCRIPTION
17 -----------
18 The *upscli_connect()* function takes the pointer 'ups' to a
19 `UPSCONN_t` state structure and opens a TCP connection to the 'host' on
20 the given 'port'.
22 'flags' may be either `UPSCLI_CONN_TRYSSL` to try a SSL
23 connection, or `UPSCLI_CONN_REQSSL` to require a SSL connection. 
25 If SSL mode is required, this function will only return successfully if
26 it is able to establish a SSL connection with the server.  Possible
27 reasons for failure include no SSL support on the server, and if
28 *upsclient* itself hasn't been compiled with SSL support.
30 You must call linkman:upscli_disconnect[3] when finished with a
31 connection, or your program will slowly leak memory and file
32 descriptors.
34 RETURN VALUE
35 ------------
37 The *upscli_connect()* function modifies the `UPSCONN_t` structure and
38 returns 0 on success, or -1 if an error occurs.
40 SEE ALSO
41 --------
42 linkman:upscli_disconnect[3], linkman:upscli_fd[3], 
43 linkman:upscli_splitaddr[3], linkman:upscli_splitname[3], 
44 linkman:upscli_ssl[3], linkman:upscli_strerror[3], 
45 linkman:upscli_upserror[3]