GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
UPSCLI_CONNECT(3) NUT Manual UPSCLI_CONNECT(3)

upscli_connect - Open a connection to a NUT upsd

#include <upsclient.h>

int upscli_connect(UPSCONN_t *ups, const char *host, int port, int flags);

The upscli_connect() function takes the pointer ups to a UPSCONN_t state structure and opens a TCP connection to the host on the given port.

flags may be either UPSCLI_CONN_TRYSSL to try a SSL connection, or UPSCLI_CONN_REQSSL to require a SSL connection.

If SSL mode is required, this function will only return successfully if it is able to establish a SSL connection with the server. Possible reasons for failure include no SSL support on the server, and if upsclient itself hasn’t been compiled with SSL support.

You must call upscli_disconnect(3) when finished with a connection, or your program will slowly leak memory and file descriptors.

The upscli_connect() function modifies the UPSCONN_t structure and returns 0 on success, or -1 if an error occurs.

upscli_disconnect(3), upscli_fd(3), upscli_splitaddr(3), upscli_splitname(3), upscli_ssl(3), upscli_strerror(3), upscli_upserror(3)
03/02/2016 Network UPS Tools 2.7.3.

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.