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.
17
18 The UPSCONN_t structure is no longer valid after this function is
19 called.
20
21 This function must be called, or your program will leak memory and file
22 descriptors.
23
25 The upscli_disconnect() function returns 0 on success, or -1 if an
26 error occurs.
27
29 upscli_connect(3), upscli_fd(3), upscli_strerror(3), upscli_upserror(3)
30
31
32
33Network UPS Tools 2.8.0 04/26/2022 UPSCLI_DISCONNECT(3)