#include <Socket.h>
Inheritance diagram for Socket:
Public Member Functions | |
Socket () | |
Constructor of the socket. | |
virtual | ~Socket () |
Destructor of the socket. | |
bool | create () |
Create socket. | |
bool | bind (const int port) |
Bind socket. | |
bool | listen () const |
Listen to socket. | |
bool | accept (Socket &) const |
Accept socket. | |
bool | connect (const std::string host, const int port) |
Connect to the host. | |
bool | send (const std::string) const |
Send string to socket. | |
int | recv (std::string &) const |
Receive string from socket. | |
void | set_non_blocking (const bool) |
Set non blocking. | |
bool | is_valid () const |
Private Attributes | |
int | m_sock |
sockaddr_in | m_addr |
|
Constructor of the socket.
Definition at line 25 of file Socket.cpp. References m_addr. |
|
Destructor of the socket.
Definition at line 35 of file Socket.cpp. References is_valid(). |
|
Accept socket.
Definition at line 116 of file Socket.cpp. References m_sock. Referenced by ServerSocket::accept(). |
|
Bind socket.
Definition at line 68 of file Socket.cpp. References is_valid(), and m_addr. Referenced by ServerSocket::ServerSocket(). |
|
Connect to the host.
Definition at line 187 of file Socket.cpp. References is_valid(), and m_addr. Referenced by ClientSocket::Connect(). |
|
Create socket.
Definition at line 46 of file Socket.cpp. References is_valid(), and m_sock. Referenced by ClientSocket::Connect(), and ServerSocket::ServerSocket(). |
|
Definition at line 65 of file Socket.h. Referenced by bind(), connect(), create(), listen(), and ~Socket(). |
|
Listen to socket.
Definition at line 94 of file Socket.cpp. References is_valid(). Referenced by ServerSocket::ServerSocket(). |
|
Receive string from socket.
Definition at line 155 of file Socket.cpp. References MAXRECV. Referenced by ServerSocket::operator>>(), and ClientSocket::operator>>(). |
|
Send string to socket.
Definition at line 136 of file Socket.cpp. Referenced by ServerSocket::operator<<(), and ClientSocket::operator<<(). |
|
Set non blocking.
Definition at line 218 of file Socket.cpp. References m_sock. |
|
|
|
Definition at line 68 of file Socket.h. Referenced by accept(), create(), and set_non_blocking(). |