aboutsummaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-12 20:14:53 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-12 20:14:53 -0800
commit1d1e8703b5735cd65fd3835573a6a66868adafa6 (patch)
treecc57311af4e97eb739b3ab2d4fb2037815111240 /src/core/socket.c
parentf00468fa4eddbdeddcd7312ff9ad878739e86464 (diff)
downloadnng-1d1e8703b5735cd65fd3835573a6a66868adafa6.tar.gz
nng-1d1e8703b5735cd65fd3835573a6a66868adafa6.tar.bz2
nng-1d1e8703b5735cd65fd3835573a6a66868adafa6.zip
More pipe details, and clarified locking / call order comments in transport.h.
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 6bb1d5d5..dffc8a2d 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -27,14 +27,13 @@
*/
struct nng_socket {
- int s_proto;
nni_mutex_t s_mx;
nni_msgqueue_t s_uwq; /* Upper write queue. */
nni_msgqueue_t s_urq; /* Upper read queue. */
- /* uwq */
- /* urq */
+ struct nni_protocol s_ops;
+
/* options */
/* pipes */
/* endpoints */
@@ -43,6 +42,22 @@ struct nng_socket {
int s_senderr; /* Protocol state machine use. */
};
+/*
+ * nni_socket_sendq and nni_socket_recvq are called by the protocol
+ * to obtain the upper read and write queues.
+ */
+nni_msgqueue_t
+nng_socket_sendq(nng_socket_t s)
+{
+ return (s->s_uwq);
+}
+
+nni_msgqueue_t
+nni_socket_recvq(nng_socket_t s)
+{
+ return (s->s_urq);
+}
+
int
nng_socket_create(nng_socket_t *sockp, int proto)
{