In-process TCP coordination server, intended to run inside rrun. More...
#include <socket_backend.hpp>
Public Member Functions | |
| SocketServer (int nranks) | |
| Start the server. More... | |
| ~SocketServer () | |
| Shut down the server and join all threads. More... | |
| std::string const & | address () const noexcept |
| Returns the server address as "127.0.0.1:<port>". More... | |
| std::string const & | token () const noexcept |
| Returns the 64-character hex-encoded 256-bit authentication token. More... | |
| SocketServer (SocketServer const &)=delete | |
| SocketServer & | operator= (SocketServer const &)=delete |
| SocketServer (SocketServer &&)=delete | |
| SocketServer & | operator= (SocketServer &&)=delete |
In-process TCP coordination server, intended to run inside rrun.
Binds to 127.0.0.1:0 (OS assigns an ephemeral port), generates a 256-bit random authentication token via getrandom(2), and starts an accept thread.
Definition at line 31 of file socket_backend.hpp.
|
explicit |
Start the server.
Binds to 127.0.0.1:0, generates a 256-bit token, and starts the accept thread. The server is ready to accept connections before this constructor returns.
| nranks | Number of rank clients expected to connect. |
| std::runtime_error | on socket/bind/listen/getrandom failure. |
| rapidsmpf::bootstrap::detail::SocketServer::~SocketServer | ( | ) |
Shut down the server and join all threads.
Closes the listen socket (which unblocks accept()), then joins the accept thread and all connection-handler threads.
|
inlinenoexcept |
Returns the server address as "127.0.0.1:<port>".
Definition at line 58 of file socket_backend.hpp.
|
inlinenoexcept |
Returns the 64-character hex-encoded 256-bit authentication token.
Definition at line 67 of file socket_backend.hpp.