Bond's TCP Library  1.0
Bond's TCP Client/Server Library
tcpsocket.h File Reference

Shared base classes for tcpclient.h and tcpserver.h. More...

#include <iostream>
#include <deque>
#include <map>
#include <vector>
#include <thread>
#include <mutex>
#include <arpa/inet.h>
#include <sys/epoll.h>
#include "tcpssl.h"
Include dependency graph for tcpsocket.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tcp::EPoll
 Encapsulates the EPoll interface. More...
 
class  tcp::Socket
 Encapsulates a socket handle that is capable of recieving epoll events. More...
 
class  tcp::DataSocket
 Represents a buffered socket that can send and receive data using optional SSL encryption. More...
 

Namespaces

 tcp
 A tcp client/server library for linux that supports openSSL and EPoll.
 

Enumerations

enum  tcp::SocketState {
  UNCONNECTED =0, LISTENING, CONNECTING, CONNECTED,
  DISCONNECTED
}
 Determines the state of a socket. More...
 

Functions

void tcp::setLogStream (ostream *os)
 Set the output stream used by the library for log, warning and error messages. More...
 
void tcp::error (string msg)
 Send an error message to the log stream.
 
void tcp::error (string label, string msg)
 Send a labelled error message to the log stream.
 
void tcp::warning (string msg)
 Send a warning message to the log stream.
 
void tcp::warning (string label, string msg)
 Send an labelled warning message to the log stream.
 
void tcp::log (string msg)
 Send an log message to the log stream.
 
void tcp::log (string label, string msg)
 Send a labelled log message to the log stream.
 
int tcp::getDomainFromHostAndPort (const char *host, const char *port, int def_domain=AF_INET)
 Tries to determine which address family to use from a host and port string. More...
 

Detailed Description

Shared base classes for tcpclient.h and tcpserver.h.

Provides Linux epoll event management, openSSL interface, and socket I/O buffering

Remarks
This library is thread safe
Applications need to call epoll.poll(100) regularly in their code for network events to function correctly.
Author
Bond Keevil
Version
1.0
Date
2019

Definition in file tcpsocket.h.