aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-14 11:38:04 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-14 11:38:04 -0800
commitff791199733ee69ca41fd0e1e567cc07e4b2f07f (patch)
treef5f2690665e0a986561252af1e9cd16a5473f938 /src
parent26d934f3aaedb81e2b2343d235b41b046084ee8a (diff)
downloadnng-ff791199733ee69ca41fd0e1e567cc07e4b2f07f.tar.gz
nng-ff791199733ee69ca41fd0e1e567cc07e4b2f07f.tar.bz2
nng-ff791199733ee69ca41fd0e1e567cc07e4b2f07f.zip
Oops... Pipe list initialization was not complete.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/core/nng_impl.h1
-rw-r--r--src/core/pipe.c13
-rw-r--r--src/core/socket.c10
4 files changed, 23 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ad9a8a0d..96e83e28 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -35,6 +35,7 @@ set (NNG_SOURCES
core/panic.c
core/panic.h
core/pipe.c
+ core/pipe.h
core/platform.c
core/platform.h
core/protocol.c
diff --git a/src/core/nng_impl.h b/src/core/nng_impl.h
index beae4056..6890c7c8 100644
--- a/src/core/nng_impl.h
+++ b/src/core/nng_impl.h
@@ -42,6 +42,7 @@
#include "core/list.h"
#include "core/msgqueue.h"
#include "core/panic.h"
+#include "core/pipe.h"
#include "core/snprintf.h"
#include "core/platform.h"
#include "core/protocol.h"
diff --git a/src/core/pipe.c b/src/core/pipe.c
index 40a810c8..5e867406 100644
--- a/src/core/pipe.c
+++ b/src/core/pipe.c
@@ -72,4 +72,17 @@ uint16_t
nni_pipe_peer(nng_pipe_t p)
{
return (p->p_ops.p_peer(p->p_tran));
+}
+
+void
+nni_pipe_destroy(nng_pipe_t p)
+{
+ p->p_ops.p_destroy(p->p_tran);
+ nni_free(p, sizeof (*p));
+}
+
+void
+nni_pipe_list_init(nni_list_t *list)
+{
+ NNI_LIST_INIT(list, struct nng_pipe, p_node);
} \ No newline at end of file
diff --git a/src/core/socket.c b/src/core/socket.c
index aeebdf25..d48f2b86 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -35,9 +35,11 @@ struct nng_socket {
struct nni_protocol s_ops;
void *s_data; /* Protocol private. */
+
/* options */
- /* pipes */
- /* endpoints */
+
+ nni_list_t s_eps;
+ nni_list_t s_pipes;
int s_besteffort; /* Best effort mode delivery. */
int s_senderr; /* Protocol state machine use. */
@@ -73,6 +75,10 @@ nng_socket_create(nng_socket_t *sockp, uint16_t proto)
return (NNG_ENOMEM);
}
sock->s_ops = *ops;
+
+ nni_pipe_list_init(&sock->s_pipes);
+ //NNI_LIST_INIT(&sock->s_eps, nng_endpt_t, ep_node);
+
if ((rv = sock->s_ops.proto_create(&sock->s_data, sock)) != 0) {
nni_free(sock, sizeof (*sock));
return (rv);