|
| Router (int bufsize=100) |
| Constructor. More...
|
|
virtual int | Bind (string endpoint) |
| Setup the connection with dealers. More...
|
|
virtual int | Send (Msg **msg) |
| If the destination socket has not connected yet, buffer this the message.
|
|
virtual Msg * | Receive () |
| Receive a message from any connected socket. More...
|
|
virtual void * | InternalID () const |
|
|
zsock_t * | router_ |
|
zpoller_t * | poller_ |
|
std::map< int, zframe_t * > | id2addr_ |
|
std::map< int, std::vector
< zmsg_t * > > | bufmsg_ |
|
int | nBufmsg_ |
|
int | bufsize_ |
|
int | local_id_ |
|
singa::Router::Router |
( |
int |
bufsize = 100 | ) |
|
Constructor.
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 |
virtual int singa::Router::Bind |
( |
string |
endpoint | ) |
|
|
virtual |
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.
virtual void* singa::Router::InternalID |
( |
| ) |
const |
|
inlinevirtual |
- Returns
- Identifier of the implementation dependent socket. E.g., zsock_t* for ZeroMQ implementation and rank for MPI implementation.
Implements singa::Socket.
virtual Msg* singa::Router::Receive |
( |
| ) |
|
|
virtual |
Receive a message from any connected socket.
- Returns
- a message pointer if success; nullptr if failure
Implements singa::Socket.
The documentation for this class was generated from the following file:
- /home/wangwei/program/asf/incubator-singa/include/communication/socket.h