CppServer  1.0.0.0
C++ Server Library
nanomsg.cpp
Go to the documentation of this file.
1 
10 
11 namespace CppServer {
12 namespace Nanomsg {
13 
14 std::ostream& operator<<(std::ostream& stream, Domain domain)
15 {
16  switch (domain)
17  {
18  case Domain::Std:
19  return stream << "Std";
20  case Domain::Raw:
21  return stream << "Raw";
22  default:
23  return stream << "<unknown>";
24  }
25 }
26 
27 std::ostream& operator<<(std::ostream& stream, Protocol protocol)
28 {
29  switch (protocol)
30  {
31  case Protocol::Pair:
32  return stream << "Pair";
33  case Protocol::Request:
34  return stream << "Request";
35  case Protocol::Reply:
36  return stream << "Reply";
38  return stream << "Publisher";
40  return stream << "Subscriber";
41  case Protocol::Push:
42  return stream << "Push";
43  case Protocol::Pull:
44  return stream << "Pull";
45  case Protocol::Surveyor:
46  return stream << "Surveyor";
48  return stream << "Respondent";
49  case Protocol::Bus:
50  return stream << "Bus";
51  default:
52  return stream << "<unknown>";
53  }
54 }
55 
56 } // namespace Nanomsg
57 } // namespace CppServer
Receives messages from the publisher. Send operation is not defined.
Socket for communication with exactly one peer.
This socket is used to send messages to a cluster of load-balanced nodes. Receive operation is not im...
Used to implement the stateless worker that receives requests and sends replies.
Distribute messages to multiple destinations. Receive operation is not defined.
C++ Server project definitions.
Definition: asio.h:24
Nanomsg C++ Library definition.
Used to send the survey. The survey is delivered to all the connected respondents.
Used to implement the client application that sends requests and receives replies.
Sent messages are distributed to all nodes in the topology. Incoming messages from all other nodes in...
std::ostream & operator<<(std::ostream &stream, Domain domain)
Stream output: Nanomsg domain.
Definition: nanomsg.cpp:14
Protocol
Nanomsg protocol.
Definition: nanomsg.h:56
Use to respond to the survey. This socket can be connected to at most one peer.
This socket is used to receive a message from a cluster of nodes. Send operation is not implemented o...
Domain
Nanomsg domain.
Definition: nanomsg.h:41
Standard full-blown socket.