rcolyer.net
RC Lib  Version 202403231100
Classes | Static Public Member Functions | List of all members
RC::Net Class Reference

Provides both client and server sides of blocking TCP connections. More...

#include <Net.h>

Classes

class  Listener
 Listens to the specified port for incoming TCP connections. More...
 

Static Public Member Functions

static void InitializeSockets ()
 Automatically called by Connect and Listener. More...
 
static bool Connect (Sock &connection, const RStr &host, const RStr &port, bool quiet_fail=true)
 Opens a TCP connection to host:port. More...
 

Detailed Description

Provides both client and server sides of blocking TCP connections.

Member Function Documentation

◆ Connect()

static bool RC::Net::Connect ( Sock connection,
const RStr host,
const RStr port,
bool  quiet_fail = true 
)
inlinestatic

Opens a TCP connection to host:port.

Will throw ErrorMsgNet upon failure to connect if quiet_fail is false.

Returns
True if the connect succeeded.

◆ InitializeSockets()

static void RC::Net::InitializeSockets ( )
inlinestatic

Automatically called by Connect and Listener.

The first time this is called, it sets SIGPIPE to ignore so the program doesn't terminate while writing to a closed socket. Call this once manually beforehand if you want to set your own custom handler for SIGPIPE.


The documentation for this class was generated from the following file:
email address
— (c) 2015