|
| Dealer (int id) |
|
int | Connect (const std::string &endpoint) |
| Setup the connection with the router. More...
|
|
int | Send (Msg **msg) override |
| Send a message to connected socket(s), non-blocking. More...
|
|
Msg * | Receive () override |
| Receive a message from any connected socket. More...
|
|
void * | InternalID () const override |
|
int singa::Dealer::Connect |
( |
const std::string & |
endpoint | ) |
|
Setup the connection with the router.
- Parameters
-
endpoint | Identifier of the router. For intra-process connection, the endpoint follows the format of ZeroMQ, i.e., starting with "inproc://"; in Singa, since each process has one router, hence we can fix the endpoint to be "inproc://router" for intra-process. For inter-process, the endpoint follows ZeroMQ's format, i.e., IP:port, where IP is the connected process. |
- Returns
- 1 connection sets up successfully; 0 otherwise
void* singa::Dealer::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::Dealer::Receive |
( |
| ) |
|
|
overridevirtual |
Receive a message from any connected socket.
- Returns
- a message pointer if success; nullptr if failure
Implements singa::SocketInterface.
int singa::Dealer::Send |
( |
Msg ** |
msg | ) |
|
|
overridevirtual |
Send a message to connected socket(s), non-blocking.
The message will be deallocated after sending, thus should not be used after calling Send();
- Parameters
-
msg | The message to be sent |
- Returns
- 1 for success queuing the message for sending, 0 for 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