Skip to content

Commit e8ae12d

Browse files
committed
To disable protocols except tcp
1 parent b7fd165 commit e8ae12d

File tree

3 files changed

+5
-219
lines changed

3 files changed

+5
-219
lines changed

CMakeLists.txt

+3-105
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ endif()
9898
option (NN_STATIC_LIB "Build static library instead of shared library." OFF)
9999
option (NN_ENABLE_DOC "Enable building documentation." ON)
100100
option (NN_ENABLE_GETADDRINFO_A "Enable/disable use of getaddrinfo_a in place of getaddrinfo." ON)
101-
option (NN_TESTS "Build and run nanomsg tests" ON)
102-
option (NN_TOOLS "Build nanomsg tools" ON)
103-
option (NN_ENABLE_NANOCAT "Enable building nanocat utility." ${NN_TOOLS})
101+
option (NN_TESTS "Build and run nanomsg tests" OFF)
102+
option (NN_TOOLS "Build nanomsg tools" OFF)
103+
104104

105105
# Platform checks.
106106

@@ -241,10 +241,6 @@ add_subdirectory (src)
241241

242242
# Build the tools
243243

244-
if (NN_ENABLE_NANOCAT)
245-
add_executable (nanocat tools/nanocat.c tools/options.c)
246-
target_link_libraries (nanocat ${PROJECT_NAME})
247-
endif ()
248244

249245
if (NN_ENABLE_DOC)
250246
find_program (ASCIIDOCTOR_EXE asciidoctor)
@@ -293,9 +289,6 @@ if (NN_ENABLE_DOC)
293289

294290
endmacro (add_libnanomsg_man)
295291

296-
if (NN_ENABLE_NANOCAT)
297-
add_libnanomsg_man (nanocat 1)
298-
endif ()
299292

300293
add_libnanomsg_man (nn_errno 3)
301294
add_libnanomsg_man (nn_strerror 3)
@@ -341,108 +334,13 @@ endif ()
341334

342335
# Build unit tests.
343336

344-
if (NN_TESTS)
345-
346-
enable_testing ()
347-
set (all_tests "")
348-
349-
set (TEST_PORT 12100)
350-
macro (add_libnanomsg_test NAME TIMEOUT)
351-
list (APPEND all_tests ${NAME})
352-
add_executable (${NAME} tests/${NAME}.c)
353-
target_link_libraries (${NAME} ${PROJECT_NAME})
354-
add_test (NAME ${NAME} COMMAND ${NAME} ${TEST_PORT})
355-
set_tests_properties (${NAME} PROPERTIES TIMEOUT ${TIMEOUT})
356-
math (EXPR TEST_PORT "${TEST_PORT}+10")
357-
endmacro (add_libnanomsg_test)
358-
359-
# Transport tests.
360-
add_libnanomsg_test (inproc 5)
361-
add_libnanomsg_test (inproc_shutdown 5)
362-
add_libnanomsg_test (ipc 5)
363-
add_libnanomsg_test (ipc_shutdown 30)
364-
add_libnanomsg_test (ipc_stress 5)
365-
add_libnanomsg_test (tcp 5)
366-
add_libnanomsg_test (tcp_shutdown 120)
367-
add_libnanomsg_test (ws 5)
368-
369-
# Protocol tests.
370-
add_libnanomsg_test (pair 5)
371-
add_libnanomsg_test (pubsub 5)
372-
add_libnanomsg_test (reqrep 5)
373-
add_libnanomsg_test (pipeline 5)
374-
add_libnanomsg_test (survey 5)
375-
add_libnanomsg_test (bus 5)
376-
377-
# Feature tests.
378-
add_libnanomsg_test (async_shutdown 30)
379-
add_libnanomsg_test (block 5)
380-
add_libnanomsg_test (term 5)
381-
add_libnanomsg_test (timeo 5)
382-
add_libnanomsg_test (iovec 5)
383-
add_libnanomsg_test (msg 5)
384-
add_libnanomsg_test (prio 5)
385-
add_libnanomsg_test (poll 5)
386-
add_libnanomsg_test (device 5)
387-
add_libnanomsg_test (device4 5)
388-
add_libnanomsg_test (device5 5)
389-
add_libnanomsg_test (device6 5)
390-
add_libnanomsg_test (device7 30)
391-
add_libnanomsg_test (emfile 5)
392-
add_libnanomsg_test (domain 5)
393-
add_libnanomsg_test (trie 5)
394-
add_libnanomsg_test (list 5)
395-
add_libnanomsg_test (hash 5)
396-
add_libnanomsg_test (stats 5)
397-
add_libnanomsg_test (symbol 5)
398-
add_libnanomsg_test (separation 5)
399-
add_libnanomsg_test (zerocopy 5)
400-
add_libnanomsg_test (shutdown 5)
401-
add_libnanomsg_test (cmsg 5)
402-
add_libnanomsg_test (bug328 5)
403-
add_libnanomsg_test (bug777 5)
404-
add_libnanomsg_test (ws_async_shutdown 5)
405-
add_libnanomsg_test (reqttl 10)
406-
add_libnanomsg_test (surveyttl 10)
407-
408-
# Platform-specific tests
409-
if (WIN32)
410-
add_libnanomsg_test (win_sec_attr 5)
411-
endif()
412-
413-
# Build the performance tests.
414337

415-
macro (add_libnanomsg_perf NAME)
416-
add_executable (${NAME} perf/${NAME}.c)
417-
target_link_libraries (${NAME} ${PROJECT_NAME})
418-
endmacro (add_libnanomsg_perf)
419-
420-
add_libnanomsg_perf (inproc_lat)
421-
add_libnanomsg_perf (inproc_thr)
422-
add_libnanomsg_perf (local_lat)
423-
add_libnanomsg_perf (remote_lat)
424-
add_libnanomsg_perf (local_thr)
425-
add_libnanomsg_perf (remote_thr)
426-
427-
endif ()
428338

429339
install (TARGETS LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
430340
install (TARGETS ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
431341
install (FILES src/nn.h DESTINATION include/nanomsg)
432-
install (FILES src/inproc.h DESTINATION include/nanomsg)
433-
install (FILES src/ipc.h DESTINATION include/nanomsg)
434342
install (FILES src/tcp.h DESTINATION include/nanomsg)
435-
install (FILES src/ws.h DESTINATION include/nanomsg)
436-
install (FILES src/pair.h DESTINATION include/nanomsg)
437-
install (FILES src/pubsub.h DESTINATION include/nanomsg)
438-
install (FILES src/reqrep.h DESTINATION include/nanomsg)
439343
install (FILES src/pipeline.h DESTINATION include/nanomsg)
440-
install (FILES src/survey.h DESTINATION include/nanomsg)
441-
install (FILES src/bus.h DESTINATION include/nanomsg)
442-
443-
if (NN_ENABLE_NANOCAT)
444-
install (TARGETS nanocat RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
445-
endif()
446344

447345
set (CPACK_PACKAGE_NAME ${PROJECT_NAME})
448346
set (CPACK_PACKAGE_VERSION ${NN_PACKAGE_VERSION})

src/CMakeLists.txt

+2-75
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,8 @@
2525

2626
set (NN_SOURCES
2727
nn.h
28-
inproc.h
29-
ipc.h
3028
tcp.h
31-
ws.h
32-
pair.h
33-
pubsub.h
34-
reqrep.h
3529
pipeline.h
36-
survey.h
37-
bus.h
3830

3931
core/ep.h
4032
core/ep.c
@@ -127,9 +119,6 @@ set (NN_SOURCES
127119
protocols/utils/priolist.h
128120
protocols/utils/priolist.c
129121

130-
protocols/bus/bus.c
131-
protocols/bus/xbus.h
132-
protocols/bus/xbus.c
133122

134123
protocols/pipeline/push.c
135124
protocols/pipeline/pull.c
@@ -138,36 +127,6 @@ set (NN_SOURCES
138127
protocols/pipeline/xpush.h
139128
protocols/pipeline/xpush.c
140129

141-
protocols/pair/pair.c
142-
protocols/pair/xpair.h
143-
protocols/pair/xpair.c
144-
145-
protocols/pubsub/pub.c
146-
protocols/pubsub/sub.c
147-
protocols/pubsub/trie.h
148-
protocols/pubsub/trie.c
149-
protocols/pubsub/xpub.h
150-
protocols/pubsub/xpub.c
151-
protocols/pubsub/xsub.h
152-
protocols/pubsub/xsub.c
153-
154-
protocols/reqrep/req.h
155-
protocols/reqrep/req.c
156-
protocols/reqrep/rep.h
157-
protocols/reqrep/rep.c
158-
protocols/reqrep/task.h
159-
protocols/reqrep/task.c
160-
protocols/reqrep/xrep.h
161-
protocols/reqrep/xrep.c
162-
protocols/reqrep/xreq.h
163-
protocols/reqrep/xreq.c
164-
165-
protocols/survey/respondent.c
166-
protocols/survey/surveyor.c
167-
protocols/survey/xrespondent.h
168-
protocols/survey/xrespondent.c
169-
protocols/survey/xsurveyor.h
170-
protocols/survey/xsurveyor.c
171130

172131
transports/utils/backoff.h
173132
transports/utils/backoff.c
@@ -188,27 +147,7 @@ set (NN_SOURCES
188147
transports/utils/base64.h
189148
transports/utils/base64.c
190149

191-
transports/inproc/binproc.h
192-
transports/inproc/binproc.c
193-
transports/inproc/cinproc.h
194-
transports/inproc/cinproc.c
195-
transports/inproc/inproc.c
196-
transports/inproc/ins.h
197-
transports/inproc/ins.c
198-
transports/inproc/msgqueue.h
199-
transports/inproc/msgqueue.c
200-
transports/inproc/sinproc.h
201-
transports/inproc/sinproc.c
202-
203-
transports/ipc/aipc.h
204-
transports/ipc/aipc.c
205-
transports/ipc/bipc.h
206-
transports/ipc/bipc.c
207-
transports/ipc/cipc.h
208-
transports/ipc/cipc.c
209-
transports/ipc/ipc.c
210-
transports/ipc/sipc.h
211-
transports/ipc/sipc.c
150+
212151

213152
transports/tcp/atcp.h
214153
transports/tcp/atcp.c
@@ -220,19 +159,7 @@ set (NN_SOURCES
220159
transports/tcp/stcp.c
221160
transports/tcp/tcp.c
222161

223-
transports/ws/aws.h
224-
transports/ws/aws.c
225-
transports/ws/bws.h
226-
transports/ws/bws.c
227-
transports/ws/cws.h
228-
transports/ws/cws.c
229-
transports/ws/sws.h
230-
transports/ws/sws.c
231-
transports/ws/ws.c
232-
transports/ws/ws_handshake.h
233-
transports/ws/ws_handshake.c
234-
transports/ws/sha1.h
235-
transports/ws/sha1.c
162+
236163
)
237164

238165
if (WIN32)

src/core/global.c

-39
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include "../utils/msg.h"
4646
#include "../utils/attr.h"
4747

48-
#include "../pubsub.h"
4948
#include "../pipeline.h"
5049

5150
#include <stddef.h>
@@ -79,65 +78,27 @@ CT_ASSERT (NN_MAX_SOCKETS <= 0x10000);
7978

8079
/* We could put these in an external header file, but there really is
8180
need to. We are the only thing that needs them. */
82-
extern struct nn_socktype nn_pair_socktype;
83-
extern struct nn_socktype nn_xpair_socktype;
84-
extern struct nn_socktype nn_pub_socktype;
85-
extern struct nn_socktype nn_sub_socktype;
86-
extern struct nn_socktype nn_xpub_socktype;
87-
extern struct nn_socktype nn_xsub_socktype;
88-
extern struct nn_socktype nn_rep_socktype;
89-
extern struct nn_socktype nn_req_socktype;
90-
extern struct nn_socktype nn_xrep_socktype;
91-
extern struct nn_socktype nn_xreq_socktype;
9281
extern struct nn_socktype nn_push_socktype;
9382
extern struct nn_socktype nn_xpush_socktype;
9483
extern struct nn_socktype nn_pull_socktype;
9584
extern struct nn_socktype nn_xpull_socktype;
96-
extern struct nn_socktype nn_respondent_socktype;
97-
extern struct nn_socktype nn_surveyor_socktype;
98-
extern struct nn_socktype nn_xrespondent_socktype;
99-
extern struct nn_socktype nn_xsurveyor_socktype;
100-
extern struct nn_socktype nn_bus_socktype;
101-
extern struct nn_socktype nn_xbus_socktype;
10285

10386
/* Array of known socket types. */
10487
const struct nn_socktype *nn_socktypes[] = {
105-
&nn_pair_socktype,
106-
&nn_xpair_socktype,
107-
&nn_pub_socktype,
108-
&nn_sub_socktype,
109-
&nn_xpub_socktype,
110-
&nn_xsub_socktype,
111-
&nn_rep_socktype,
112-
&nn_req_socktype,
113-
&nn_xrep_socktype,
114-
&nn_xreq_socktype,
11588
&nn_push_socktype,
11689
&nn_xpush_socktype,
11790
&nn_pull_socktype,
11891
&nn_xpull_socktype,
119-
&nn_respondent_socktype,
120-
&nn_surveyor_socktype,
121-
&nn_xrespondent_socktype,
122-
&nn_xsurveyor_socktype,
123-
&nn_bus_socktype,
124-
&nn_xbus_socktype,
12592
NULL,
12693
};
12794

12895
/* As with protocols, we could have these in a header file, but we are the
12996
only consumer, so just declare them inline. */
13097

131-
extern struct nn_transport nn_inproc;
132-
extern struct nn_transport nn_ipc;
13398
extern struct nn_transport nn_tcp;
134-
extern struct nn_transport nn_ws;
13599

136100
const struct nn_transport *nn_transports[] = {
137-
&nn_inproc,
138-
&nn_ipc,
139101
&nn_tcp,
140-
&nn_ws,
141102
NULL,
142103
};
143104

0 commit comments

Comments
 (0)