carta
nutclient_tcp_set_timeout(3)

nutclient_tcp_set_timeout3

Tcp protocol related function for network ups tools high-level client access library

Part of libnutclient_tcp(3).

Usage

typedef NUTCLIENT_t NUTCLIENT_TCP_t;

NUTCLIENT_TCP_t nutclient_tcp_create_client(

int nutclient_tcp_is_connected(NUTCLIENT_TCP_t client);

void nutclient_tcp_disconnect(NUTCLIENT_TCP_t client);

int nutclient_tcp_reconnect(NUTCLIENT_TCP_t client);

time_t nutclient_tcp_get_timeout(NUTCLIENT_TCP_t client);

Overview

These functions allow to manage connections to upsd(8) using NUT TCP protocol.

The nutclient_tcp_create_client() function create the NUTCLIENT_TCP_t context and intend to connect to upsd at host and port. The context must be freed by nutclient_destroy()

• host can be a sever name or a valid IPv4 or IPv6 address like "localhost", "127.0.0.1" or "::1".

• port is a valid TCP port, generally 3493.

The nutclient_tcp_is_connected() function test if the connection is valid.

The nutclient_tcp_disconnect() function force to disconnect the specified connection.

The nutclient_tcp_reconnect() function force to reconnect a connection, disconnecting it if needed.

The nutclient_tcp_set_timeout() function set the timeout duration for I/O operations.

The nutclient_tcp_get_timeout() function retrieve the timeout duration for I/O operations.

timeout values are specified in seconds, negatives values for blocking.

History

  • Debian 13 (Trixie): the text shown here
  • Debian 12 (Bookworm)
  • Debian 11 (Bullseye) to Debian 9 (Stretch)

From libnutclient-dev 2.8.1-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.