nut/docs/man/libnutclient_tcp.3

74 lines
3.1 KiB
Groff
Raw Permalink Normal View History

2013-11-24 15:00:12 +00:00
'\" t
.\" Title: libnutclient_tcp
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
2015-04-30 13:53:36 +00:00
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
2016-07-18 00:11:41 +00:00
.\" Date: 03/02/2016
2013-11-24 15:00:12 +00:00
.\" Manual: NUT Manual
2016-07-18 00:11:41 +00:00
.\" Source: Network UPS Tools 2.7.3.1
2013-11-24 15:00:12 +00:00
.\" Language: English
.\"
2016-07-18 00:11:41 +00:00
.TH "LIBNUTCLIENT_TCP" "3" "03/02/2016" "Network UPS Tools 2\&.7\&.3\&." "NUT Manual"
2013-11-24 15:00:12 +00:00
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
libnutclient_tcp, nutclient_tcp_create_client, nutclient_tcp_is_connected, nutclient_tcp_disconnect, nutclient_tcp_reconnect, nutclient_tcp_set_timeout, nutclient_tcp_get_timeout \- TCP protocol related function for Network UPS Tools high\-level client access library
.SH "SYNOPSIS"
.sp
.nf
#include <nutclient\&.h>
.fi
.sp
.nf
typedef NUTCLIENT_t NUTCLIENT_TCP_t;
.fi
.sp
.nf
NUTCLIENT_TCP_t nutclient_tcp_create_client(const char* host, unsigned short port);
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);
void nutclient_tcp_set_timeout(NUTCLIENT_TCP_t client, long timeout);
long nutclient_tcp_get_timeout(NUTCLIENT_TCP_t client);
.fi
.SH "DESCRIPTION"
.sp
These functions allow to manage connections to \fBupsd\fR(8) using NUT TCP protocol\&.
.sp
The \fBnutclient_tcp_create_client()\fR function create the \fINUTCLIENT_TCP_t\fR context and intend to connect to upsd at \fIhost\fR and \fIport\fR\&. The context must be freed by \fInutclient_destroy()\fR
.sp
\fIhost\fR can be a sever name or a valid IPv4 or IPv6 adress like "localhost", "127\&.0\&.0\&.1" or "::1"\&.
.sp
\fIport\fR is a valid TCP port, genrally 3493\&.
.sp
The \fBnutclient_tcp_is_connected()\fR function test if the connection is valid\&.
.sp
The \fBnutclient_tcp_disconnect()\fR function force to disconnect the specified connection\&.
.sp
The \fBnutclient_tcp_reconnect()\fR function force to reconnect a connection, disconnecting it if needed\&.
.sp
The \fBnutclient_tcp_set_timeout()\fR function set the timeout duration for I/O operations\&.
.sp
The \fBnutclient_tcp_get_timeout()\fR function retrieve the timeout duration for I/O operations\&.
.sp
\fItimeout\fR values are specified in seconds, negatives values for blocking\&.
.SH "SEE ALSO"
.sp
\fBlibnutclient\fR(3) \fBlibnutclient_general\fR(3)