|
| 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...
|
|
void | Reset () override |
| Close if non-empty. 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...
|
|
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...
|
|
bool | Wait (std::chrono::milliseconds timeout, Event requested, Event *occurred=nullptr) const override |
| Wait for readiness for input (recv) or output (send). More...
|
|
| Sock () |
| Default constructor, creates an empty object that does nothing when destroyed. More...
|
|
| 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 SOCKET | Get () const |
| Get the value of the contained socket. More...
|
|
virtual SOCKET | Release () |
| Get the value of the contained socket and drop ownership. More...
|
|
virtual void | SendComplete (const std::string &data, std::chrono::milliseconds timeout, CThreadInterrupt &interrupt) const |
| Send the given data, retrying on transient errors. 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...
|
|
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 94 of file net.h.