Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
5679fa2
* submodule nng step1
JaylinYu Aug 3, 2021
fce9ed8
add nanomq's include dir into nng submodule
JaylinYu Aug 3, 2021
c54781b
* NEW sync
JaylinYu Aug 3, 2021
4cdd582
Fix premature transport registration. Mark it deprecated.
gdamore Aug 1, 2021
f716cca
* FIX #1486 by waking up latest aio each time. (#1487)
JaylinYu Aug 9, 2021
f244123
fixes #1478 mbedTLS 3.0 is not API compatible with 2.x
gdamore Aug 9, 2021
457e208
fixes #1488 aio expiration list performance work needed
gdamore Aug 10, 2021
1ae437d
Bump version v1.5.2
gdamore Aug 11, 2021
4a41148
* FIX [mqtt_parser] band-aid fix for issue #200
JaylinYu Aug 15, 2021
59afa54
Remove separate protocol initialization step.
gdamore Aug 8, 2021
312fcfc
* FIX [nng/tcp] mqtt CONNECT length protection #203
JaylinYu Aug 17, 2021
956a72f
* NEW [NNG/WS] add mqtt over websocket support - modify transport la…
JaylinYu Aug 27, 2021
6c1aae5
* NEW [nng/sp] add ws_pipe_start func
JaylinYu Aug 27, 2021
96f845c
* NEW [nng/ws] add support for mqtt over websocket 2. PINGREQ/PINGRESQ
JaylinYu Aug 28, 2021
d6f27d4
* RM [nng/api] remove duplicated variable_ptr api.
JaylinYu Aug 30, 2021
6805263
* NEW [nng] move msg ptr related logic out from transport layer.
JaylinYu Aug 30, 2021
f8661a6
* MDF [message/mqtt_parser] move nano_msg_get_subtopic API out from …
JaylinYu Aug 31, 2021
c1748cc
* MDF [nano_tcp/tcp] set payload ptr at protocol layer
JaylinYu Aug 31, 2021
72a775a
* NEW [websocket] support SUBSCRIBE & UNSUBSCRIBE MQTT over websocket
JaylinYu Aug 31, 2021
802aaed
Update README.adoc
JaylinYu Aug 31, 2021
0e4fe9a
* MDF [nng/core] move MQTT oriented API out from core part of nng in…
JaylinYu Aug 31, 2021
0452cf0
Resolved compile warning
alvin1221 Sep 2, 2021
a262313
Merge pull request #2 from nanomq/alvin/develop
alvin1221 Sep 2, 2021
f8ed171
* MDF [nano_tcp] reply PUBACK/PUBREL/PUBCOMP in protocol layer
JaylinYu Sep 3, 2021
cad6958
Resolved warning in mqtt_parser.c
alvin1221 Sep 3, 2021
424eaf5
* MDF [tcp/nano_tcp] remove useless variables & format code
JaylinYu Sep 3, 2021
852f587
Merge branch 'master' of github.com:nanomq/nng
alvin1221 Sep 3, 2021
ce4764a
* NEW [websocket/qos1] support QoS 1 MQTT over Websocket
JaylinYu Sep 3, 2021
f8fea95
New nng API for get/set prov_extra;
alvin1221 Sep 6, 2021
6d4afd3
Add a field "msg" to pub_extra & releated API
alvin1221 Sep 7, 2021
47d75c7
Collate code
alvin1221 Sep 7, 2021
ed1a1ac
* NEW [nano_tcp] move clean session to broker layer
Sep 2, 2021
3f04a3a
* FIX [nano_tcp] fix the memory leak due to no enough ctx.
Sep 4, 2021
e33c77b
* FIX [nano_tcp] remove code (comment or not) about clean session.
Sep 5, 2021
cfaa1cf
* FIX [nano_tcp] remove nano_clean_session var
JaylinYu Sep 10, 2021
0d450f3
* FIX [mqtt_parser] function nano_msg_composer supports reuse msg
Sep 10, 2021
955cb8c
* NEW [mqtt_parser] add refcnt parameter in conn_param & rename inter…
Sep 11, 2021
6b77679
Move protocol.c into SP tree (it is SP specific.)
gdamore Aug 21, 2021
cc4e708
Remove unused prototypes.
gdamore Aug 21, 2021
7f6b6a3
Minor cleanups.
gdamore Aug 21, 2021
b967e5a
fixes #1498 Endpoint close/shutdown could be synchronous (#1499)
gdamore Sep 5, 2021
fa3beb3
SP initialization cannot fail.
gdamore Sep 6, 2021
c704ede
* FIX [mqtt_parser] remove function unused.
Sep 17, 2021
0e6c23f
Merge pull request #6 from nanomq/wangha/dev
wanghaEMQ Sep 17, 2021
2ba946d
* FIX [aio_qos] rever #216, Fix #222
JaylinYu Sep 18, 2021
e501ca8
Add QoS bits packing with message pointer to nano_pipe rlmq
Sep 18, 2021
435e134
* NEW [nng/mqtt] fix QoS bits methdology
JaylinYu Sep 20, 2021
b3051ec
* FIX [nano_tcp/websocket] Fix #223 & #222 by adapting qos bits method
JaylinYu Sep 20, 2021
df7d61d
* FIX [nano_tcp/timer] timer kick connections via aio_finish_error, …
JaylinYu Sep 24, 2021
1777d14
* RM [pipe] remove unused nano_db of pipe struct
JaylinYu Sep 26, 2021
32964f8
* FIX [transport/mqtt] fix QoS message ID increment logic.
JaylinYu Sep 26, 2021
98f610a
* MDF [mqtt/tcp] remove redundant code.
JaylinYu Sep 27, 2021
a293797
* NEW [mqtt/websocket] full support QoS 1/2 msg
JaylinYu Sep 27, 2021
afca3d0
* FIX [protocol/nano_tcp] use correct msg pointer when resending qos…
JaylinYu Oct 2, 2021
0c889d8
Eliminate the pipe mutex and use atomic for pipe closed.
gdamore Sep 6, 2021
4e2b9bc
fixes #1347 windows IPC accept cancellation not wired up
gdamore Nov 16, 2020
b77034e
Remove redundant check.
gdamore Sep 6, 2021
a53ec06
Minor cleanups.
gdamore Sep 6, 2021
209733f
* FIX [nano_tcp/timer] keepalive timer should be protected by a mutex
JaylinYu Oct 7, 2021
8389aa5
Add submodule "mqtt-codec"
alvin1221 Oct 14, 2021
6804277
Add submodule "mqtt-codec"
alvin1221 Oct 14, 2021
a725fa9
Update mqtt-codec
alvin1221 Oct 15, 2021
4c5ba62
Merge commit 'a725fa9278c8cad608f689d09c748a492da9212a' into nng-mqtt
alvin1221 Oct 15, 2021
c6459b6
MQTT API swag.
gdamore Jun 18, 2021
398eab6
Add message option manipulation.
gdamore Jun 18, 2021
a712530
Use protocol private data instead of options for messages.
gdamore Jun 19, 2021
680c129
* FIX [demo] fix camkefile of reqrep demo
JaylinYu Oct 15, 2021
287e6cd
* NEW [nng/mqtt] add independent transport layer of mqtt
JaylinYu Oct 15, 2021
9749c4a
* NEW [nng/mqtt] add independent stream scheme for mqtt
JaylinYu Oct 15, 2021
8a5cbc7
* NEW [nng/cmake] use correct MACRO for mqtt_tcp
JaylinYu Oct 18, 2021
fdc36da
* MDF [nng/mqtt] rename all functions of transport/mqtt/mqtt_tcp.c
alvin1221 Oct 18, 2021
08e6812
* FIX [nng/mqtt] definition NNG_TRANSPORT_MQTT_TCP usage
alvin1221 Oct 21, 2021
58d9bd2
* NEW [nng/mqtt] nni_mqtt_msg releated APIs
alvin1221 Oct 21, 2021
595c040
* NEW [nano_tcp] msg cache/restore in clean session is supported.
Oct 3, 2021
07f0d20
* FIX [nano_tcp] rename variable qos_timer as qos_duration.
Oct 14, 2021
ebf8889
* FIX [nano_tcp] fix the memleak about cached msg
Oct 21, 2021
f4f6b5a
* FIX [nano_tcp] make cached msg unique, it ensures no leaks exists.
Oct 22, 2021
8f0cccd
New [nng/mqtt] mqtt msg related APIs
alvin1221 Oct 26, 2021
e49af14
* NEW [nng/mqtt] mqtt msg encode APIs for nni_mqtt_msg_encode
alvin1221 Oct 27, 2021
7dfcff6
* MDF [nng/mqtt] nng_mqtt_msg decode APIs, remove mqtt_codec submodul…
alvin1221 Oct 29, 2021
d88f80d
Add Remaining_length function
alvin1221 Oct 29, 2021
9e43241
Fix mqtt_get_remaining_length()
alvin1221 Oct 29, 2021
911f421
* MDF [nng/transport] modify mqtt-tcp/transport recv_cb for mqtt usage
JaylinYu Oct 22, 2021
7e4d4fa
Fix nng_mqtt_client_open function signature
Oct 22, 2021
d8f42dd
Fix mqtt tcp transport receicve
Oct 22, 2021
7bd296f
Add mqtt_client protocol
Oct 23, 2021
8949452
Add mqtt_client demo
Oct 24, 2021
df0c6e8
Update mqtt_client protocol
Oct 28, 2021
160cb07
Fix mqtt_tcp receive callback when rxlen contains more than one packet
Oct 29, 2021
e1d1375
Add support connmsg set/get
Oct 28, 2021
11b6f7a
Add connmsg sent in dialer
Oct 29, 2021
5059e3c
* MDF [nng/mqtt] branches merged
JaylinYu Oct 29, 2021
b03a63c
* FIX [mqtt_codec] fix connect packet
JaylinYu Oct 30, 2021
64c0cfa
Remove nng msg header guard
Oct 30, 2021
8e8d372
* MDF [mqtt/transport] adapt mqtt_tcp to new msg API style (fixedhea…
JaylinYu Oct 30, 2021
b345fdd
* MDF [mqtt/transport] move qos ack/rec/rel/comp to transport
JaylinYu Oct 30, 2021
767f68d
Expose nng_mqtt_topic & nng_mqtt_topic_qos data structures
alvin1221 Nov 1, 2021
cd28587
Add publish encode test & Resolve conflicts
alvin1221 Nov 1, 2021
8885d2d
Add default client id & New unit tests
alvin1221 Nov 1, 2021
3a5078b
Fix mqtt protocol according to mqtt transport
Oct 31, 2021
f57acd6
Fix mqtt protocol wrong sock mutex unlocking
Oct 31, 2021
b3daeda
Add nni_mqtt_msg_get_packet_id and nni_mqtt_msg_set_packet_id
Oct 31, 2021
8411872
Fix mqtt protocol pipe receive callback getting wrong packet id
Oct 31, 2021
3e3a4ef
Fix mqtt_client demo
Nov 1, 2021
9b9bf72
Refactor mqtt protocol
Oct 31, 2021
41ee228
Fix mqtt protocol msg len calculation
Oct 31, 2021
4513129
Fix mqtt protocol to correctly release messages
Oct 31, 2021
84a9471
Add mqtt protocol keep alive support
Nov 1, 2021
44f8927
Fix mqtt protocol to encode send packet id
Nov 1, 2021
70a3199
Fix mqtt protocol compilation error
Nov 1, 2021
f956ccb
* NEW [demo] connack msg could be access in connect callback.
Nov 1, 2021
d586e19
* FIX [mqtt_tcp] set default value for elements added in struct mqtt_…
Nov 1, 2021
fa03015
Add publish encode test & Resolve conflicts
alvin1221 Nov 1, 2021
a5984a9
Add default client id & New unit tests
alvin1221 Nov 1, 2021
96dba39
* FIX [mqtt_codec] read freed memory
alvin1221 Nov 2, 2021
018a52a
Fix mqtt procotol PUBLISH QoS 2 message error
Nov 2, 2021
5955bc4
Fix mqtt protocol pipe send data race
Nov 3, 2021
ca6c0fe
* FIX [mqtt_tcp] fix the conflict on p->rxmsg.
Nov 4, 2021
0d5741f
* FIX [mqtt_tcp] Make a defination for connmsg.
Nov 5, 2021
0d1e8b3
Fix mqtt protocol pipe receive dead lock
Nov 3, 2021
42789a2
Remove mqtt protocol pipe useless data member
Nov 4, 2021
5fd6cb0
* NEW [mqtt_async] add nng-style (with context) MQTT demo
alvin1221 Nov 3, 2021
2bdc5d2
* FIX [mqtt_tcp] handle received invalid packet & update mqtt_async demo
alvin1221 Nov 4, 2021
a2734e4
* FIX [mqtt_codec] decode pubrel/unsubscribe
alvin1221 Nov 4, 2021
65cd616
* MDF [mqtt] nng_mqtt_msg_get_publish_topic() & demo/mqtt_async
alvin1221 Nov 5, 2021
7393029
* NEW [docs/man] Update MQTT message docs
AlvinWong2018 Nov 5, 2021
60a2997
* TEST: help passing nng test.
Nov 8, 2021
5a536f7
Remove mqtt protocol useless comments
Nov 8, 2021
49f5c91
Fix mqtt protocol typos
Nov 8, 2021
7eed4cd
Refactor mqtt protocol
Nov 8, 2021
b181c48
Add mqtt protocol retransmit support
Nov 8, 2021
88fe857
* FIX [mqtt_tcp] deadlock in mqtt_tcptran_pipe_recv_cb
alvin1221 Nov 10, 2021
cec38a0
* NEW [mqtt_codec] free/dup methods for some mqtt packets in need
alvin1221 Nov 10, 2021
4f143be
Remove unused eq_len member.
gdamore Oct 11, 2021
718ae5b
fixes #1518 Disconnect during negotiation breaks listener
gdamore Oct 17, 2021
d45cdb1
Use env shebangs everywhere (#1515)
Oct 27, 2021
8ef2042
fixes #1346 windows ipc winsec fails frequently in CI/CD
gdamore Oct 28, 2021
3543d5a
* FIX [mqtt_test] 'SEGV on unknown address'
alvin1221 Nov 12, 2021
bec4605
Fix mqtt client protocol state machine
Nov 12, 2021
868e895
* FIX [mqtt_tcp] move process of encoding msg to mqtt_tcp from demo.
Nov 16, 2021
e4e49c6
* FIX [demo/mqtt] fix some error in the sync client demo.
Nov 17, 2021
1eac113
* FIX [mqtt.c] fix the error of utf8-string setting in connect package.
wanghaEMQ Nov 18, 2021
0c40cbd
Remove mqtt protocol pre-allocated work list
Nov 16, 2021
fd8da8f
Fix mqtt protocol to release resources correctly
Nov 17, 2021
5469d5d
Fix mqtt protocol context receive operation
Nov 17, 2021
16112c1
* FIX [mqtt_parser] fix #200 (error reintroduced by commit 0452cf0)
JaylinYu Nov 19, 2021
40dc505
Fix mqtt codec CONNECT encode handler dangling pointer
Nov 19, 2021
9221c03
* MDF [demo/mqtt_async, demo/mqtt] remove encode/decode from mqtt cli…
alvin1221 Nov 22, 2021
ecbb9bb
* FIX [mqtt] compile warning & error on Windows
alvin1221 Nov 23, 2021
2f5d8b8
* FIX [mqtt_test] run failed on Windows
alvin1221 Nov 23, 2021
9ed169a
* FIX [mqtt] dup invalid content before encoding.
alvin1221 Nov 23, 2021
dd5b154
Fix mqtt protocol to encode all messages according to codec
Nov 23, 2021
7a7a8d2
Fix mqtt protocol pipe start
Nov 23, 2021
3186d06
Fix mqtt protocol keep alive timer performance
Nov 23, 2021
0db3d58
* MDF [protocol/mqtt] move protocol layer of nanomq to independent dir.
JaylinYu Nov 26, 2021
6c73e30
* MDF [transport/mqtt] add independet dir & url for mqtt's transport…
JaylinYu Nov 26, 2021
f9b8a04
* MDF [transport/websocket] move mqtt over websocket to independent …
JaylinYu Nov 26, 2021
be30b4e
* MDF [transport/websocket] restore SP's websocket support. Add inde…
JaylinYu Nov 29, 2021
4b9867f
Remove unused eq_len member.
gdamore Oct 11, 2021
6d93083
fixes #1518 Disconnect during negotiation breaks listener
gdamore Oct 17, 2021
e6a2e68
Use env shebangs everywhere (#1515)
Oct 27, 2021
d3fe0b8
fixes #1346 windows ipc winsec fails frequently in CI/CD
gdamore Oct 28, 2021
6b3b17a
fix building with PAIR and PUBSUB disabled (#1530)
urkle Nov 26, 2021
96e5138
update demos to not use deprecated functions (#1531)
urkle Nov 28, 2021
dffbb46
fixes #1526 NNG_USE_CLOCKID Bug?
gdamore Nov 28, 2021
1d56a7f
Don't use deprecated function in test.
gdamore Nov 28, 2021
2d513b4
* FIX [transport/mqtt_tcp] adapt to the fix of upstream.
JaylinYu Nov 29, 2021
50b8021
* FIX [protocol/CMakeList] fix compiling errors
JaylinYu Nov 29, 2021
f38eeb6
*NEW [mqtt_tls] tls support
alvin1221 Nov 28, 2021
9853189
FIX [mqtt_tls] set tls config failed
alvin1221 Nov 28, 2021
3bc84d2
* FIX [mqtt_tls] connect fail & tls config error
alvin1221 Nov 29, 2021
54073bf
* FIX [mqtt_codec] double free proto name
alvin1221 Nov 29, 2021
64b4ded
* NEW [dialer] New callback interface for dialer.
wanghaEMQ Nov 30, 2021
408ef82
* RM [nano_tcp] rm old nano_tcp file from reqrep protocol.
JaylinYu Nov 30, 2021
795bcf8
* FIX [mqtt_client] set more args for nng_mqtt_cb.
wanghaEMQ Nov 30, 2021
692e8e2
Merge remote-tracking branch 'origin/nng-mqtt' into develop
JaylinYu Dec 1, 2021
b31eba5
* MDF [mqtt_tls] adapt to mqtt_tcp
alvin1221 Nov 30, 2021
d922551
* MDF [mqtt] remove 'printf'
alvin1221 Dec 1, 2021
4307d23
* FIX [mqtt_tcp] fix unnecessary trigger of user disconnect cb.
wanghaEMQ Dec 1, 2021
c287b15
* MDF [docs] description of MQTT related APIs
alvin1221 Dec 1, 2021
b9a64d6
* NEW [nmq_mqtt] Generate random clientid for the clients without cli…
Dec 1, 2021
1c033a5
* FIX [core/message] seperate CMD_TYPE and message type
JaylinYu Dec 1, 2021
3991458
Merge remote-tracking branch 'origin/master' into jaylin/bridge
JaylinYu Dec 1, 2021
26fa986
Merge remote-tracking branch 'origin/nng-mqtt' into jaylin/bridge
JaylinYu Dec 1, 2021
d685248
* MDF [transport/mqtt_tls] remove duplicated msg_get_oub_id.
JaylinYu Dec 1, 2021
cc17253
Merge branch 'jaylin/bridge'
JaylinYu Dec 1, 2021
dc23f4e
* FIX [protocol/mqtt] temp fix for auto-reconnect.
JaylinYu Dec 1, 2021
7bdb919
* NEW [nng] Add new log system.
xinyi-xs Dec 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ColumnLimit: 79
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignTrailingComments: true
AlignEscapedNewlinesLeft: true
AlignEscapedNewlines: Left
PointerAlignment: Right
ForEachMacros: ['NNI_LIST_FOREACH']
AlwaysBreakAfterReturnType: TopLevelDefinitions
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "extern/nng-wolfssl"]
path = extern/nng-wolfssl
url = https://github.com/staysail/nng-wolfssl
path = extern/nng-wolfssl
url = https://github.com/staysail/nng-wolfssl
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Copyright (c) 2015-2016 Jack R. Dunaway. All rights reserved.
# Copyright 2016 Franklin "Snaipe" Mathieu <[email protected]>
# Copyright 2018 Capitar IT Group BV <[email protected]>
# Copyright 2020 EMQX. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
Expand Down Expand Up @@ -252,12 +253,15 @@ endif ()
add_subdirectory(src)

if (NNG_TESTS)
add_subdirectory(tests)
# add_subdirectory(tests)
endif ()

# Build the tools

add_subdirectory(docs/man)
# add_subdirectory(docs/man)

include_directories(${CMAKE_SOURCE_DIR}/nanolib/include)
include_directories(${CMAKE_SOURCE_DIR}/nanomq/include)

set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${NNG_PACKAGE_VERSION})
Expand Down
5 changes: 5 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
This is NNG repo of NanoMQ project. I have updated it to support MQTT protocol.




ifdef::env-github[]
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
Expand Down
3 changes: 3 additions & 0 deletions cmake/CheckSanitizer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ macro (CheckSanitizer)
set (NNG_SANITIZER none CACHE STRING "Sanitizer to use (clang or gcc).")
set_property(CACHE NNG_SANITIZER PROPERTY STRINGS ${NNG_SAN_LIST})
mark_as_advanced (NNG_SANITIZER)
if (DEBUG AND ASAN)
set (NNG_SANITIZER address)
endif (DEBUG AND ASAN)

if (NOT NNG_SANITIZER STREQUAL "none")
set (NNG_C_FLAG_SANITIZER "-fsanitize=${NNG_SANITIZER}")
Expand Down
24 changes: 24 additions & 0 deletions cmake/NNGOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ mark_as_advanced(NNG_PROTO_RESPONDENT0)
option (NNG_PROTO_SURVEYOR0 "Enable SURVEYORv0 protocol." ON)
mark_as_advanced(NNG_PROTO_SURVEYOR0)

option (NNG_PROTO_MQTT_CLIENT "Enable MQTT Client protocol." ON)
mark_as_advanced(NNG_PROTO_MQTT_CLIENT)

option (NNG_PROTO_MQTT_BROKER "Enable MQTT Broker protocol." ON)
mark_as_advanced(NNG_PROTO_MQTT_BROKER)

# TLS support.

# Enabling TLS is required to enable support for the TLS transport
Expand Down Expand Up @@ -115,14 +121,32 @@ mark_as_advanced(NNG_TRANSPORT_IPC)
option (NNG_TRANSPORT_TCP "Enable TCP transport." ON)
mark_as_advanced(NNG_TRANSPORT_TCP)

# MQTT TCP transport
option (NNG_TRANSPORT_MQTT_TCP "Enable MQTT TCP transport." ON)
mark_as_advanced(NNG_TRANSPORT_MQTT_TCP)

# TLS transport
option (NNG_TRANSPORT_TLS "Enable TLS transport." ON)
mark_as_advanced(NNG_TRANSPORT_TLS)

# MQTT TLS transport
option (NNG_TRANSPORT_MQTT_TLS "Enable MQTT TLS transport." ON )
mark_as_advanced(NNG_TRANSPORT_MQTT_TLS)

# WebSocket
option (NNG_TRANSPORT_WS "Enable WebSocket transport." ON)
mark_as_advanced(NNG_TRANSPORT_WS)

# MQTT Client
option (NNG_TRANSPORT_MQTT_TCP "Enable MQTT TCP transport." ON)
mark_as_advanced(NNG_TRANSPORT_MQTT_TCP)

#MQTT Broker
option (NNG_TRANSPORT_MQTT_BROKER_TCP "Enable MQTT BROKER TCP transport." ON)
mark_as_advanced(NNG_TRANSPORT_MQTT_BROKER_TCP)



CMAKE_DEPENDENT_OPTION(NNG_TRANSPORT_WSS "Enable WSS transport." ON
"NNG_ENABLE_TLS" OFF)
mark_as_advanced(NNG_TRANSPORT_WSS)
Expand Down
8 changes: 6 additions & 2 deletions demo/async/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@
# file was obtained (LICENSE.txt). A copy of the license may also be
# found online at https://opensource.org/licenses/MIT.

cmake_minimum_required (VERSION 2.8.7)
cmake_minimum_required (VERSION 2.8.12)

project(nng-asyncdemo)

set(PARALLEL 128 CACHE STRING "Parallelism (min 4, max 1000)")

# Call this from your own project's makefile.
find_package(nng CONFIG REQUIRED)
find_package(Threads)

find_package(Threads)

add_executable(server server.c)
target_link_libraries(server nng::nng)
target_compile_definitions(server PRIVATE -DPARALLEL=${PARALLEL})
target_compile_definitions(server PRIVATE NNG_ELIDE_DEPRECATED PARALLEL=${PARALLEL})

add_executable(client client.c)
target_compile_definitions(client PRIVATE NNG_ELIDE_DEPRECATED)
target_link_libraries(client nng::nng)
2 changes: 1 addition & 1 deletion demo/async/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

ADDR=ipc:///tmp/async_demo
COUNT=10
Expand Down
5 changes: 4 additions & 1 deletion demo/http_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
# file was obtained (LICENSE.txt). A copy of the license may also be
# found online at https://opensource.org/licenses/MIT.

cmake_minimum_required (VERSION 2.8.7)
cmake_minimum_required (VERSION 2.8.12)

project(http_client)

# Call this from your own project's makefile.
find_package(nng CONFIG REQUIRED)

find_package(Threads)

add_executable(http_client http_client.c)
target_link_libraries(http_client nng::nng)
target_compile_definitions(http_client PRIVATE NNG_ELIDE_DEPRECATED)
17 changes: 17 additions & 0 deletions demo/mqtt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# This software is supplied under the terms of the MIT License, a
# copy of which should be located in the distribution where this
# file was obtained (LICENSE.txt). A copy of the license may also be
# found online at https://opensource.org/licenses/MIT.

cmake_minimum_required (VERSION 2.8.7)

project(mqtt_client)

find_package(nng CONFIG REQUIRED)

find_package(Threads)

add_executable(mqtt_client mqtt_client.c)
target_link_libraries(mqtt_client nng)
target_link_libraries(mqtt_client ${CMAKE_THREAD_LIBS_INIT})
Loading