|
| StaticContentsSock (const std::string &contents) |
|
| ~StaticContentsSock () override |
|
StaticContentsSock & | operator= (Sock &&other) override |
| Move assignment operator, grab the socket from another object and close ours (if set). More...
|
|
ssize_t | Send (const void *, size_t len, int) const override |
| send(2) wrapper. More...
|
|
ssize_t | Recv (void *buf, size_t len, int flags) const override |
| recv(2) wrapper. More...
|
|
int | Connect (const sockaddr *, socklen_t) const override |
| connect(2) wrapper. More...
|
|
int | Bind (const sockaddr *, socklen_t) const override |
| bind(2) wrapper. More...
|
|
int | Listen (int) const override |
| listen(2) wrapper. More...
|
|
std::unique_ptr< Sock > | Accept (sockaddr *addr, socklen_t *addr_len) const override |
| accept(2) wrapper. More...
|
|
int | GetSockOpt (int level, int opt_name, void *opt_val, socklen_t *opt_len) const override |
| getsockopt(2) wrapper. More...
|
|
int | SetSockOpt (int, int, const void *, socklen_t) const override |
| setsockopt(2) wrapper. More...
|
|
int | GetSockName (sockaddr *name, socklen_t *name_len) const override |
| getsockname(2) wrapper. More...
|
|
bool | SetNonBlocking () const override |
| Set the non-blocking option on the socket. More...
|
|
bool | IsSelectable () const override |
| Check if the underlying socket can be used for select(2) (or the Wait() method). More...
|
|
bool | Wait (std::chrono::milliseconds timeout, Event requested, Event *occurred=nullptr) const override |
| Wait for readiness for input (recv) or output (send). More...
|
|
bool | WaitMany (std::chrono::milliseconds timeout, EventsPerSock &events_per_sock) const override |
| Same as Wait() , but wait on many sockets within the same timeout. More...
|
|
bool | IsConnected (std::string &) const override |
| Check if still connected. More...
|
|
| Sock ()=delete |
|
| Sock (SOCKET s) |
| Take ownership of an existent socket. More...
|
|
| Sock (const Sock &)=delete |
| Copy constructor, disabled because closing the same socket twice is undesirable. More...
|
|
| Sock (Sock &&other) |
| Move constructor, grab the socket from another object and close ours (if set). More...
|
|
virtual | ~Sock () |
| Destructor, close the socket or do nothing if empty. More...
|
|
Sock & | operator= (const Sock &)=delete |
| Copy assignment operator, disabled because closing the same socket twice is undesirable. More...
|
|
virtual Sock & | operator= (Sock &&other) |
| Move assignment operator, grab the socket from another object and close ours (if set). More...
|
|
virtual ssize_t | Send (const void *data, size_t len, int flags) const |
| send(2) wrapper. More...
|
|
virtual ssize_t | Recv (void *buf, size_t len, int flags) const |
| recv(2) wrapper. More...
|
|
virtual int | Connect (const sockaddr *addr, socklen_t addr_len) const |
| connect(2) wrapper. More...
|
|
virtual int | Bind (const sockaddr *addr, socklen_t addr_len) const |
| bind(2) wrapper. More...
|
|
virtual int | Listen (int backlog) const |
| listen(2) wrapper. More...
|
|
virtual std::unique_ptr< Sock > | Accept (sockaddr *addr, socklen_t *addr_len) const |
| accept(2) wrapper. More...
|
|
virtual int | GetSockOpt (int level, int opt_name, void *opt_val, socklen_t *opt_len) const |
| getsockopt(2) wrapper. More...
|
|
virtual int | SetSockOpt (int level, int opt_name, const void *opt_val, socklen_t opt_len) const |
| setsockopt(2) wrapper. More...
|
|
virtual int | GetSockName (sockaddr *name, socklen_t *name_len) const |
| getsockname(2) wrapper. More...
|
|
virtual bool | SetNonBlocking () const |
| Set the non-blocking option on the socket. More...
|
|
virtual bool | IsSelectable () const |
| Check if the underlying socket can be used for select(2) (or the Wait() method). More...
|
|
virtual bool | Wait (std::chrono::milliseconds timeout, Event requested, Event *occurred=nullptr) const |
| Wait for readiness for input (recv) or output (send). More...
|
|
virtual bool | WaitMany (std::chrono::milliseconds timeout, EventsPerSock &events_per_sock) const |
| Same as Wait() , but wait on many sockets within the same timeout. More...
|
|
virtual void | SendComplete (Span< const unsigned char > data, std::chrono::milliseconds timeout, CThreadInterrupt &interrupt) const |
| Send the given data, retrying on transient errors. More...
|
|
virtual void | SendComplete (Span< const char > data, std::chrono::milliseconds timeout, CThreadInterrupt &interrupt) const |
| Convenience method, equivalent to SendComplete(MakeUCharSpan(data), timeout, interrupt) . More...
|
|
virtual std::string | RecvUntilTerminator (uint8_t terminator, std::chrono::milliseconds timeout, CThreadInterrupt &interrupt, size_t max_data) const |
| Read from socket until a terminator character is encountered. More...
|
|
virtual bool | IsConnected (std::string &errmsg) const |
| Check if still connected. More...
|
|
bool | operator== (SOCKET s) const |
| Check if the internal socket is equal to s . More...
|
|
A mocked Sock alternative that returns a statically contained data upon read and succeeds and ignores all writes.
The data to be returned is given to the constructor and when it is exhausted an EOF is returned by further reads.
Definition at line 139 of file net.h.