|
| TCPConnection () |
| Default constructor is not doing anything. More...
|
|
void | Close () override |
| also close session connection More...
|
|
void | CloseListenerOnly () |
| only closes the listening socket, but not a connected session More...
|
|
void | listen (int numConnections=1) |
| listen for incoming connections More...
|
|
bool | accept (bool bUnlisten=false) |
| accept an incoming connections, optinally stop listening More...
|
|
bool | listenAccept (int numConnections=1) |
| combines listening and accepting More...
|
|
bool | IsConnected () const |
| Connected to a counterparty? More...
|
|
bool | send (const char *msg) override |
| send messages on session connection More...
|
|
| SocketNetworking () |
| Default constructor is not doing anything. More...
|
|
virtual | ~SocketNetworking () |
| Destructor makes sure the socket is closed. More...
|
|
virtual void | Open (const std::string &_addr, int _port, size_t _bufSize=512, unsigned _timeOut_ms=0, bool _bBroadcast=false) |
| Creates a socket and binds it to the given local address. More...
|
|
virtual void | Connect (const std::string &_addr, int _port, size_t _bufSize, unsigned _timeOut_ms=0) |
| Creates a socket and connects it to the given remote server. More...
|
|
bool | isOpen () const |
| Is a socket open? More...
|
|
void | SetBufSize (size_t _bufSize) |
| (Re)Sets the buffer size (or clears it if _bufSize==0 ) More...
|
|
SOCKET | getSocket () const |
| the socket More...
|
|
int | getPort () const |
| the port More...
|
|
std::string | getAddr () const |
| the interface address More...
|
|
const char * | getBuf () const |
| return the buffer More...
|
|
void | setBlocking (bool bBlock) |
| Set blocking mode. More...
|
|
long | recv (std::string *_pFromAddr=nullptr, SockAddrTy *_pFromSockAddr=nullptr) |
| Waits to receive a message, ensures zero-termination in the buffer. More...
|
|
long | timedRecv (int max_wait_ms, std::string *_pFromAddr=nullptr, SockAddrTy *_pFromSockAddr=nullptr) |
| Waits to receive a message with timeout, ensures zero-termination in the buffer. More...
|
|
bool | broadcast (const char *msg) |
| Sends a broadcast message. More...
|
|
Listens to TCP connections and opens a session socket upon connect.