|
| | TCPSocket ()=default |
| |
| auto | Domain () const -> SockDomain |
| | Return the socket domain. More...
|
| |
| bool | IsClosed () const |
| |
| Result | GetSockError () const |
| | get last error code if any More...
|
| |
| bool | BadSocket () const |
| | check if anything bad happens More...
|
| |
| Result | NonBlocking (bool non_block) |
| |
| bool | NonBlocking () const |
| |
| Result | RecvTimeout (std::chrono::seconds timeout) |
| |
| Result | SetBufSize (std::int32_t n_bytes) |
| |
| Result | SendBufSize (std::int32_t *n_bytes) |
| |
| Result | RecvBufSize (std::int32_t *n_bytes) |
| |
| Result | SetKeepAlive () |
| |
| Result | SetNoDelay (std::int32_t no_delay=1) |
| |
| TCPSocket | Accept () |
| | Accept new connection, returns a new TCP socket for the new connection. More...
|
| |
| Result | Accept (TCPSocket *out, SockAddress *addr) |
| |
| | ~TCPSocket () |
| |
| | TCPSocket (TCPSocket const &that)=delete |
| |
| | TCPSocket (TCPSocket &&that) noexcept(true) |
| |
| TCPSocket & | operator= (TCPSocket const &that)=delete |
| |
| TCPSocket & | operator= (TCPSocket &&that) noexcept(true) |
| |
| HandleT const & | Handle () const |
| | Return the native socket file descriptor. More...
|
| |
| Result | Listen (std::int32_t backlog=256) |
| | Listen to incoming requests. Should be called after bind. More...
|
| |
| Result | BindHost (std::int32_t *p_out) |
| | Bind socket to INADDR_ANY, return the port selected by the OS. More...
|
| |
| auto | Port () const |
| |
| Result | Bind (StringView ip, std::int32_t *port) |
| |
| Result | SendAll (void const *buf, std::size_t len, std::size_t *n_sent) |
| | Send data, without error then all data should be sent. More...
|
| |
| Result | RecvAll (void *buf, std::size_t len, std::size_t *n_recv) |
| | Receive data, without error then all data should be received. More...
|
| |
| auto | Send (const void *buf_, std::size_t len, std::int32_t flags=0) |
| | Send data using the socket. More...
|
| |
| auto | Recv (void *buf, std::size_t len, std::int32_t flags=0) |
| | receive data using the socket More...
|
| |
| std::size_t | Send (StringView str) |
| | Send string, format is matched with the Python socket wrapper in RABIT. More...
|
| |
| Result | Recv (std::string *p_str) |
| | Receive string, format is matched with the Python socket wrapper in RABIT. More...
|
| |
| Result | Close () |
| | Close the socket, called automatically in destructor if the socket is not closed. More...
|
| |
| Result | Shutdown () |
| | Call shutdown on the socket. More...
|
| |
TCP socket for simple communication.