aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2021-08-01 08:25:58 -0700
committerGarrett D'Amore <garrett@damore.org>2021-08-01 08:25:58 -0700
commit524a3f6ec6e1e921c16ff18997ae494cad09f860 (patch)
tree17eb6bf491a1c75fa510392eb7df76769e36d163 /src/sp/transport.c
parent5e5881391bfa6e261ab0f6349a5f12a526e2f293 (diff)
downloadnng-524a3f6ec6e1e921c16ff18997ae494cad09f860.tar.gz
nng-524a3f6ec6e1e921c16ff18997ae494cad09f860.tar.bz2
nng-524a3f6ec6e1e921c16ff18997ae494cad09f860.zip
Fix premature transport registration. Mark it deprecated.
Originally the idea was to better support having the transports be separate loadable modules. This isn't needed for the builtin transports, so we make the explicit initialization of them deprecated, and document it as such.
Diffstat (limited to 'src/sp/transport.c')
-rw-r--r--src/sp/transport.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/sp/transport.c b/src/sp/transport.c
index dba530e0..13961eaa 100644
--- a/src/sp/transport.c
+++ b/src/sp/transport.c
@@ -11,25 +11,6 @@
#include "core/nng_impl.h"
-#ifdef NNG_TRANSPORT_INPROC
-#include "nng/transport/inproc/inproc.h"
-#endif
-#ifdef NNG_TRANSPORT_IPC
-#include "nng/transport/ipc/ipc.h"
-#endif
-#ifdef NNG_TRANSPORT_TCP
-#include "nng/transport/tcp/tcp.h"
-#endif
-#ifdef NNG_TRANSPORT_TLS
-#include "nng/transport/tls/tls.h"
-#endif
-#ifdef NNG_TRANSPORT_WS
-#include "nng/transport/ws/websocket.h"
-#endif
-#ifdef NNG_TRANSPORT_ZEROTIER
-#include "nng/transport/zerotier/zerotier.h"
-#endif
-
#include <stdio.h>
#include <string.h>
@@ -67,6 +48,28 @@ nni_sp_tran_find(nni_url *url)
// nni_sp_tran_sys_init initializes the entire transport subsystem, including
// each individual transport.
+#ifdef NNG_TRANSPORT_INPROC
+extern void nni_sp_inproc_register(void);
+#endif
+#ifdef NNG_TRANSPORT_IPC
+extern void nni_sp_ipc_register(void);
+#endif
+#ifdef NNG_TRANSPORT_TCP
+extern void nni_sp_tcp_register(void);
+#endif
+#ifdef NNG_TRANSPORT_TLS
+extern void nni_sp_tls_register(void);
+#endif
+#ifdef NNG_TRANSPORT_WS
+extern void nni_sp_ws_register(void);
+#endif
+#ifdef NNG_TRANSPORT_WSS
+extern void nni_sp_wss_register(void);
+#endif
+#ifdef NNG_TRANSPORT_ZEROTIER
+extern void nni_sp_zt_register(void);
+#endif
+
int
nni_sp_tran_sys_init(void)
{
@@ -74,25 +77,25 @@ nni_sp_tran_sys_init(void)
nni_rwlock_init(&sp_tran_lk);
#ifdef NNG_TRANSPORT_INPROC
- nng_inproc_register();
+ nni_sp_inproc_register();
#endif
#ifdef NNG_TRANSPORT_IPC
- nng_ipc_register();
+ nni_sp_ipc_register();
#endif
#ifdef NNG_TRANSPORT_TCP
- nng_tcp_register();
+ nni_sp_tcp_register();
#endif
#ifdef NNG_TRANSPORT_TLS
- nng_tls_register();
+ nni_sp_tls_register();
#endif
#ifdef NNG_TRANSPORT_WS
- nng_ws_register();
+ nni_sp_ws_register();
#endif
#ifdef NNG_TRANSPORT_WSS
- nng_wss_register();
+ nni_sp_wss_register();
#endif
#ifdef NNG_TRANSPORT_ZEROTIER
- nng_zt_register();
+ nni_sp_zt_register();
#endif
return (0);
}