CppServer  1.0.0.0
C++ Server Library
nanomsg.h
Go to the documentation of this file.
1 
9 #ifndef CPPSERVER_NANOMSG_H
10 #define CPPSERVER_NANOMSG_H
11 
12 #define NN_STATIC_LIB
13 
14 #include <nn.h>
15 
16 // Nanomsg protocols
17 #include <bus.h>
18 #include <pair.h>
19 #include <pipeline.h>
20 #include <pubsub.h>
21 #include <reqrep.h>
22 #include <survey.h>
23 
24 // Nanomsg transport
25 #include <inproc.h>
26 #include <ipc.h>
27 #include <tcp.h>
28 #include <ws.h>
29 
30 #include <iostream>
31 
32 namespace CppServer {
33 
38 namespace Nanomsg {
39 
41 enum class Domain
42 {
43  Std = AF_SP,
44  Raw = AF_SP_RAW
45 };
46 
48 
53 std::ostream& operator<<(std::ostream& stream, Domain domain);
54 
56 enum class Protocol
57 {
58  Pair = NN_PAIR,
59  Request = NN_REQ,
60  Reply = NN_REP,
61  Publisher = NN_PUB,
62  Subscriber = NN_SUB,
63  Push = NN_PUSH,
64  Pull = NN_PULL,
65  Surveyor = NN_SURVEYOR,
66  Respondent = NN_RESPONDENT,
67  Bus = NN_BUS
68 };
69 
71 
76 std::ostream& operator<<(std::ostream& stream, Protocol protocol);
77 
78 } // namespace Nanomsg
79 
80 } // namespace CppServer
81 
82 #endif // CPPSERVER_NANOMSG_H
Nanomsg bus node definition.
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.
Nanomsg bus node.
Definition: bus.h:39
Distribute messages to multiple destinations. Receive operation is not defined.
C++ Server project definitions.
Definition: asio.h:24
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.
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.