1UPSCLI_DISCONNECT(3) NUT Manual UPSCLI_DISCONNECT(3)
2
3
4
6 upscli_disconnect - disconnect from a UPS server
7
9 #include <upsclient.h>
10
11 int upscli_disconnect(UPSCONN_t *ups);
12
14 The upscli_disconnect() function takes the pointer ups to a UPSCONN_t
15 state structure, shuts down the connection to the server, and frees
16 dynamic memory used by the state structure. The UPSCONN_t structure is
17 no longer valid after this function is called.
18
19 This function must be called, or your program will leak memory and file
20 descriptors.
21
23 The upscli_disconnect() function returns 0 on success, or -1 if an
24 error occurs.
25
27 upscli_connect(3), upscli_fd(3), upscli_strerror(3), upscli_upserror(3)
28
29
30
31Network UPS Tools 2.7.3. 03/02/2016 UPSCLI_DISCONNECT(3)