|
| Router (int bufsize) |
| There is only one router per procs, hence its local id is 0 and is not set explicitly. More...
|
|
int | Bind (const std::string &endpoint) |
| Setup the connection with dealers. More...
|
|
int | Send (Msg **msg) override |
| If the destination socket has not connected yet, buffer this the message.
|
|
Msg * | Receive () override |
| Receive a message from any connected socket. More...
|
|
void * | InternalID () const override |
|
|
int | nBufmsg_ = 0 |
|
int | bufsize_ = 100 |
|
singa::Router::Router |
( |
int |
bufsize | ) |
|
|
explicit |
There is only one router per procs, hence its local id is 0 and is not set explicitly.
- Parameters
-
bufsize | Buffer at most this number of messages |
int singa::Router::Bind |
( |
const std::string & |
endpoint | ) |
|
Setup the connection with dealers.
It automatically binds to the endpoint for intra-process communication, i.e., "inproc://router".
- Parameters
-
endpoint | The identifier for the Dealer socket in other process to connect. It has the format IP:Port, where IP is the host machine. If endpoint is empty, it means that all connections are intra-process connection. |
- Returns
- number of connected dealers.
void* singa::Router::InternalID |
( |
| ) |
const |
|
overridevirtual |
- Returns
- Identifier of the implementation dependent socket. E.g., zsock_t* for ZeroMQ implementation and rank for MPI implementation.
Implements singa::SocketInterface.
Msg* singa::Router::Receive |
( |
| ) |
|
|
overridevirtual |
Receive a message from any connected socket.
- Returns
- a message pointer if success; nullptr if failure
Implements singa::SocketInterface.
The documentation for this class was generated from the following file:
- /home/wangwei/program/asf/release-0.1/apache-singa-incubating-0.1.0-RC1/include/communication/socket.h