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

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

#include <Net.h>

Public Member Functions

 Listener (const RStr &port)
 Begin listening to the specified port for incoming TCP connections. More...
 
 ~Listener ()
 If open, this closes the port being listened to.
 
SOCKET Raw () const
 Provides the raw socket descriptor being listened to.
 
bool Accept (Sock &connection, bool quiet_fail=true)
 Accept an incoming connection, with read/write access through the FileRW connection. More...
 

Detailed Description

Listens to the specified port for incoming TCP connections.

Constructor & Destructor Documentation

◆ Listener()

RC::Net::Listener::Listener ( const RStr port)
inline

Begin listening to the specified port for incoming TCP connections.

Use Accept to accept a connection.

Member Function Documentation

◆ Accept()

bool RC::Net::Listener::Accept ( Sock connection,
bool  quiet_fail = true 
)
inline

Accept an incoming connection, with read/write access through the FileRW connection.

This throws an ErrorMsgNet on error if quiet_fail is false.

Returns
False if an error occurred.

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