summaryrefslogtreecommitdiff
path: root/src/xs.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-04-21 07:07:57 +0200
committerMartin Sustrik <sustrik@250bpm.com>2012-04-21 07:07:57 +0200
commit36fd87810274329c8cd86344b95a0521541e7bab (patch)
treeec183c7dd3a9b1de3361e7211cbffc960d139cf1 /src/xs.cpp
parentd26e86aa0afc3ec2534eacb4131aee8f6805c36a (diff)
xs_shutdown implemented
This patch allows for partial shutdown of the socket. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/xs.cpp')
-rw-r--r--src/xs.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/xs.cpp b/src/xs.cpp
index 7f4cdd2..81daded 100644
--- a/src/xs.cpp
+++ b/src/xs.cpp
@@ -212,6 +212,17 @@ int xs_connect (void *s_, const char *addr_)
return rc;
}
+int xs_shutdown (void *s_, int how_)
+{
+ xs::socket_base_t *s = (xs::socket_base_t*) s_;
+ if (!s || !s->check_tag ()) {
+ errno = ENOTSOCK;
+ return -1;
+ }
+ int rc = s->shutdown (how_);
+ return rc;
+}
+
int xs_send (void *s_, const void *buf_, size_t len_, int flags_)
{
xs_msg_t msg;