Go to the documentation of this file.
24 # define TCPSOCKET_HH_
101 void connect(
const std::string& hostname,
int port);
166 std::string& host,
unsigned int psize);
std::string _read_line_bin(int socket, int &port, std::string &host, unsigned int psize)
Get a line from socket and store client hostname and port in port and host variable (when used with b...
TcpSocket(int socket, SOCKET_VERSION version=V4)
std::string get_ip(TcpSocket *client) const
return ip of client (after an accept)
TcpSocket(PROTO_KIND pkind, SOCKET_VERSION version=V4)
Network namespace represent all networks connection.
This class represent an abstract socket connection (udp | tcp server | tcp client)
This class represent a tcp connection (client and server)
enum Network::e_pkind PROTO_KIND
TcpSocket(SOCKET_VERSION version=V4)
void connect(const std::string &hostname, int port)
Connect as an TCP client.
void close()
Close the connection.
enum Network::e_version SOCKET_VERSION
TcpSocket * accept() const
accept a new client (For server only)
TcpSocket(int socket, PROTO_KIND pkind, SOCKET_VERSION version=V4)