File tree Expand file tree Collapse file tree 11 files changed +1227
-0
lines changed
include/nng/protocol/hub0 Expand file tree Collapse file tree 11 files changed +1227
-0
lines changed Original file line number Diff line number Diff line change 1
1
#
2
2
# Copyright 2020 Staysail Systems, Inc. <[email protected] >
3
+ # Copyright 2022 Cogent Embedded, Inc.
3
4
#
4
5
# This software is supplied under the terms of the MIT License, a
5
6
# copy of which should be located in the distribution where this
@@ -46,6 +47,9 @@ mark_as_advanced(NNG_ENABLE_STATS)
46
47
option (NNG_PROTO_BUS0 "Enable BUSv0 protocol." ON )
47
48
mark_as_advanced (NNG_PROTO_BUS0)
48
49
50
+ option (NNG_PROTO_HUB0 "Enable HUBv0 protocol." ON )
51
+ mark_as_advanced (NNG_PROTO_HUB0)
52
+
49
53
option (NNG_PROTO_PAIR0 "Enable PAIRv0 protocol." ON )
50
54
mark_as_advanced (NNG_PROTO_PAIR0)
51
55
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ if (NNG_ENABLE_DOC)
82
82
nng_aio_wait
83
83
nng_alloc
84
84
nng_bus_open
85
+ nng_hub_open
85
86
nng_close
86
87
nng_ctx_close
87
88
nng_ctx_get
@@ -379,6 +380,7 @@ if (NNG_ENABLE_DOC)
379
380
set (NNG_MAN7
380
381
nng
381
382
nng_bus
383
+ nng_hub
382
384
nng_inproc
383
385
nng_ipc
384
386
nng_pair
Original file line number Diff line number Diff line change 4
4
// Copyright 2018 Capitar IT Group BV <[email protected] >
5
5
// Copyright 2019 Devolutions <[email protected] >
6
6
// Copyright 2020 Dirac Research <[email protected] >
7
+ // Copyright 2022 Cogent Embedded, Inc.
7
8
//
8
9
// This document is supplied under the terms of the MIT License, a
9
10
// copy of which should be located in the distribution where this
@@ -193,6 +194,7 @@ The following functions are used to construct a socket with a specific protocol:
193
194
194
195
|===
195
196
|xref:nng_bus_open.3.adoc[nng_bus_open()]|open a bus socket
197
+ |xref:nng_hub_open.3.adoc[nng_hub_open()]|open a hub socket
196
198
|xref:nng_pair_open.3.adoc[nng_pair_open()]|open a pair socket
197
199
|xref:nng_pub_open.3.adoc[nng_pub_open()]|open a pub socket
198
200
|xref:nng_pull_open.3.adoc[nng_pull_open()]|open a pull socket
Original file line number Diff line number Diff line change 1
1
= nng(7)
2
2
//
3
+ // Copyright 2022 Cogent Embedded, Inc.
3
4
// Copyright 2019 Staysail Systems, Inc. <[email protected] >
4
5
// Copyright 2018 Capitar IT Group BV <[email protected] >
5
6
//
@@ -54,6 +55,7 @@ other languages please check the http://nanomsg.org/[website].
54
55
55
56
[horizontal]
56
57
xref:nng_bus.7.adoc[nng_bus(7)]:: Bus protocol
58
+ xref:nng_hub.7.adoc[nng_hub(7)]:: Hub protocol
57
59
xref:nng_pair.7.adoc[nng_pair(7)]:: Pair protocol
58
60
xref:nng_pub.7.adoc[nng_pub(7)]:: Publisher side of publish/subscribe protocol
59
61
xref:nng_pull.7.adoc[nng_pull(7)]:: Pull side of pipeline protocol
Original file line number Diff line number Diff line change
1
+ = nng_hub(7)
2
+ //
3
+ // Copyright 2022 Cogent Embedded, Inc.
4
+ //
5
+ // This document is supplied under the terms of the MIT License, a
6
+ // copy of which should be located in the distribution where this
7
+ // file was obtained (LICENSE.txt). A copy of the license may also be
8
+ // found online at https://opensource.org/licenses/MIT.
9
+ //
10
+
11
+ == NAME
12
+
13
+ nng_hub - hub protocol
14
+
15
+ == SYNOPSIS
16
+
17
+ [source,c]
18
+ ----
19
+ #include <nng/protocol/hub0/hub.h>
20
+ ----
21
+
22
+ == DESCRIPTION
23
+
24
+ (((protocol, _hub_)))
25
+ The ((_hub_ protocol)) provides for building star networks where
26
+ all peers are connected to one peer.
27
+ In this protocol, each message sent by a node is sent to every one of
28
+ its directly connected peers.
29
+
30
+ All message delivery in this pattern is guaranteed.
31
+
32
+ This protocol is compatible with pair0
33
+
34
+ === Socket Operations
35
+
36
+ The xref:nng_hub_open.3.adoc[`nng_hub0_open()`] functions create a hub socket.
37
+ This socket may be used to send and receive messages.
38
+ Sending messages will attempt to deliver to each connected peer.
39
+
40
+ === Protocol Versions
41
+
42
+ Only version 0 of this protocol is supported.
43
+ (At the time of writing, no other versions of this protocol have been defined.)
44
+
45
+ === Protocol Options
46
+
47
+ The _hub_ protocol has no protocol-specific options.
48
+
49
+ === Protocol Headers
50
+
51
+ No message headers are present.
52
+
53
+ == SEE ALSO
54
+
55
+ [.text-left]
56
+ xref:nng_hub_open.3.adoc[nng_hub_open(3)],
57
+ xref:nng_pair.7.adoc[nng_pair],
58
+ xref:nng.7.adoc[nng(7)]
Original file line number Diff line number Diff line change
1
+ = nng_hub_open(3)
2
+ //
3
+ // Copyright 2022 Cogent Embedded, Inc.
4
+ //
5
+ // This document is supplied under the terms of the MIT License, a
6
+ // copy of which should be located in the distribution where this
7
+ // file was obtained (LICENSE.txt). A copy of the license may also be
8
+ // found online at https://opensource.org/licenses/MIT.
9
+ //
10
+
11
+ == NAME
12
+
13
+ nng_hub_open - create hub socket
14
+
15
+ == SYNOPSIS
16
+
17
+ [source,c]
18
+ ----
19
+ #include <nng/nng.h>
20
+ #include <nng/protocol/hub0/hub.h>
21
+
22
+ int nng_hub0_open(nng_socket *s);
23
+ ----
24
+
25
+ == DESCRIPTION
26
+
27
+ The `nng_hub0_open()` function creates a xref:nng_hub.7.adoc[_hub_] version 0
28
+ xref:nng_socket.5.adoc[socket] and returns it at the location pointed to by _s_.
29
+
30
+ == RETURN VALUES
31
+
32
+ These functions return 0 on success, and non-zero otherwise.
33
+
34
+ == ERRORS
35
+
36
+ [horizontal]
37
+ `NNG_ENOMEM`:: Insufficient memory is available.
38
+ `NNG_ENOTSUP`:: The protocol is not supported.
39
+
40
+ == SEE ALSO
41
+
42
+ [.text-left]
43
+ xref:nng_socket.5.adoc[nng_socket(5)],
44
+ xref:nng_hub.7.adoc[nng_hub(7)],
45
+ xref:nng.7.adoc[nng(7)]
Original file line number Diff line number Diff line change
1
+ //
2
+ // Copyright 2022 Cogent Embedded, Inc.
3
+ //
4
+ // This software is supplied under the terms of the MIT License, a
5
+ // copy of which should be located in the distribution where this
6
+ // file was obtained (LICENSE.txt). A copy of the license may also be
7
+ // found online at https://opensource.org/licenses/MIT.
8
+ //
9
+ #ifndef NNG_PROTOCOL_HUB0_HUB_H
10
+ #define NNG_PROTOCOL_HUB0_HUB_H
11
+
12
+ #ifdef __cplusplus
13
+ extern "C" {
14
+ #endif
15
+
16
+ #define NNG_HUB0_SELF 0x10
17
+ #define NNG_HUB0_PEER 0x10
18
+ #define NNG_HUB0_SELF_NAME "hub"
19
+ #define NNG_HUB0_PEER_NAME "hub"
20
+
21
+ NNG_DECL int nng_hub0_open (nng_socket * );
22
+
23
+ #ifndef nng_hub_open
24
+ #define nng_hub_open nng_hub0_open
25
+ #endif
26
+
27
+ #ifdef __cplusplus
28
+ }
29
+ #endif
30
+
31
+ #endif /* NNG_PROTOCOL_HUB0_HUB_H_ */
Original file line number Diff line number Diff line change 1
1
#
2
2
# Copyright 2020 Staysail Systems, Inc. <[email protected] >
3
+ # Copyright 2022 Cogent Embedded, Inc.
3
4
#
4
5
# This software is supplied under the terms of the MIT License, a
5
6
# copy of which should be located in the distribution where this
11
12
nng_directory(protocol)
12
13
13
14
add_subdirectory (bus0)
15
+ add_subdirectory (hub0)
14
16
add_subdirectory (pair0)
15
17
add_subdirectory (pair1)
16
18
add_subdirectory (pipeline0)
Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright 2022 Cogent Embedded, Inc.
3
+ #
4
+ # This software is supplied under the terms of the MIT License, a
5
+ # copy of which should be located in the distribution where this
6
+ # file was obtained (LICENSE.txt). A copy of the license may also be
7
+ # found online at https://opensource.org/licenses/MIT.
8
+ #
9
+
10
+ nng_directory(hub0)
11
+
12
+ nng_sources_if(NNG_PROTO_HUB0 hub.c)
13
+ nng_headers_if(NNG_PROTO_HUB0 nng/protocol/hub0/hub.h)
14
+ nng_defines_if(NNG_PROTO_HUB0 NNG_HAVE_HUB0)
15
+
16
+ nng_test(hub_test)
You can’t perform that action at this time.
0 commit comments