1LIBNUTCLIENT_TCP(3) NUT Manual LIBNUTCLIENT_TCP(3)
2
3
4
6 libnutclient_tcp, nutclient_tcp_create_client,
7 nutclient_tcp_is_connected, nutclient_tcp_disconnect,
8 nutclient_tcp_reconnect, nutclient_tcp_set_timeout,
9 nutclient_tcp_get_timeout - TCP protocol related function for Network
10 UPS Tools high-level client access library
11
13 #include <nutclient.h>
14
15 typedef NUTCLIENT_t NUTCLIENT_TCP_t;
16
17 NUTCLIENT_TCP_t nutclient_tcp_create_client(const char* host, unsigned short port);
18 int nutclient_tcp_is_connected(NUTCLIENT_TCP_t client);
19 void nutclient_tcp_disconnect(NUTCLIENT_TCP_t client);
20 int nutclient_tcp_reconnect(NUTCLIENT_TCP_t client);
21 void nutclient_tcp_set_timeout(NUTCLIENT_TCP_t client, long timeout);
22 long nutclient_tcp_get_timeout(NUTCLIENT_TCP_t client);
23
25 These functions allow to manage connections to upsd(8) using NUT TCP
26 protocol.
27
28 The nutclient_tcp_create_client() function create the NUTCLIENT_TCP_t
29 context and intend to connect to upsd at host and port. The context
30 must be freed by nutclient_destroy()
31
32 host can be a sever name or a valid IPv4 or IPv6 adress like
33 "localhost", "127.0.0.1" or "::1".
34
35 port is a valid TCP port, genrally 3493.
36
37 The nutclient_tcp_is_connected() function test if the connection is
38 valid.
39
40 The nutclient_tcp_disconnect() function force to disconnect the
41 specified connection.
42
43 The nutclient_tcp_reconnect() function force to reconnect a connection,
44 disconnecting it if needed.
45
46 The nutclient_tcp_set_timeout() function set the timeout duration for
47 I/O operations.
48
49 The nutclient_tcp_get_timeout() function retrieve the timeout duration
50 for I/O operations.
51
52 timeout values are specified in seconds, negatives values for blocking.
53
55 libnutclient(3) libnutclient_general(3)
56
57
58
59Network UPS Tools 2.7.3. 03/02/2016 LIBNUTCLIENT_TCP(3)