A minimal IPv4 TCP socket. More...
#include <shmem_carrier/ShmemPlatform.h>
Public Member Functions | |
| Socket ()=default | |
| ~Socket () | |
| Socket (const Socket &)=delete | |
| Socket & | operator= (const Socket &)=delete |
| bool | listen (int port) |
| Listen on all the interfaces (port 0 means any free port) | |
| bool | accept (Socket &stream) |
| Accept a connection on a listening socket. | |
| bool | connect (const std::string &host, int port) |
| bool | sendAll (const void *data, size_t len) |
| Send exactly len bytes (blocking socket) | |
| bool | recvAll (void *data, size_t len) |
| Receive exactly len bytes (blocking socket) | |
| bool | isPeerClosed () |
| Check, on a non-blocking socket, whether the connection was closed or reset by the peer (e.g. | |
| bool | setNonBlocking () |
| bool | getLocalAddress (std::string &host, int &port) const |
| bool | getRemoteAddress (std::string &host, int &port) const |
| void | close () |
A minimal IPv4 TCP socket.
Definition at line 93 of file ShmemPlatform.h.
|
default |
| shmem::Socket::~Socket | ( | ) |
Definition at line 521 of file ShmemPlatform.cpp.
|
delete |
| bool shmem::Socket::accept | ( | Socket & | stream | ) |
Accept a connection on a listening socket.
Definition at line 559 of file ShmemPlatform.cpp.
| void shmem::Socket::close | ( | ) |
Definition at line 753 of file ShmemPlatform.cpp.
| bool shmem::Socket::connect | ( | const std::string & | host, |
| int | port | ||
| ) |
Definition at line 580 of file ShmemPlatform.cpp.
| bool shmem::Socket::getLocalAddress | ( | std::string & | host, |
| int & | port | ||
| ) | const |
Definition at line 727 of file ShmemPlatform.cpp.
| bool shmem::Socket::getRemoteAddress | ( | std::string & | host, |
| int & | port | ||
| ) | const |
Definition at line 740 of file ShmemPlatform.cpp.
| bool shmem::Socket::isPeerClosed | ( | ) |
Check, on a non-blocking socket, whether the connection was closed or reset by the peer (e.g.
because the peer process died)
Definition at line 684 of file ShmemPlatform.cpp.
| bool shmem::Socket::listen | ( | int | port | ) |
Listen on all the interfaces (port 0 means any free port)
Definition at line 526 of file ShmemPlatform.cpp.
| bool shmem::Socket::recvAll | ( | void * | data, |
| size_t | len | ||
| ) |
Receive exactly len bytes (blocking socket)
Definition at line 660 of file ShmemPlatform.cpp.
| bool shmem::Socket::sendAll | ( | const void * | data, |
| size_t | len | ||
| ) |
Send exactly len bytes (blocking socket)
Definition at line 630 of file ShmemPlatform.cpp.
| bool shmem::Socket::setNonBlocking | ( | ) |
Definition at line 710 of file ShmemPlatform.cpp.