'\" t .\" Title: xs_bind .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 06/13/2012 .\" Manual: Crossroads I/O Manual .\" Source: Crossroads I/O 1.2.0 .\" Language: English .\" .TH "XS_BIND" "3" "06/13/2012" "Crossroads I/O 1\&.2\&.0" "Crossroads I/O Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" xs_shutdown \- shut down part of the socket .SH "SYNOPSIS" .sp \fBint xs_shutdown (void \fR\fB\fI*socket\fR\fR\fB, int \fR\fB\fIhow\fR\fR\fB);\fR .SH "DESCRIPTION" .sp This function partially closes the socket\&. It disconnects or unbinds an endpoint previously connected or bound by \fIxs_bind()\fR or \fIxs_connect()\fR\&. \fIhow\fR parameter is the endpoint ID as returned by \fIxs_bind()\fR or \fIxs_connect()\fR\&. .sp Endpoint shutdown honours \fIlinger\fR socket option\&. I\&.e\&. if there are any pending outbound messages, Crossroads will try to push them to the network for the specified amount of time before giving up\&. .sp Note: inproc endpoints don\(cqt support partial shutdown at the moment\&. .SH "RETURN VALUE" .sp The \fIxs_shutdown()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The endpoint ID supplied doesn\(cqt correspond to any active endpoint\&. .RE .PP \fBENOTSUP\fR .RS 4 Specified endpoint doesn\(cqt support partial shutdown\&. .RE .PP \fBETERM\fR .RS 4 The \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .SH "EXAMPLE" .PP \fBBinding socket to an endpoint, then unbinding it\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create a socket */ void *socket = xs_socket (context, XS_PUB); assert (socket); /* Bind it to a TCP endpoint */ int id = xs_bind (socket, "tcp://*:5555"); assert (id != \-1); /* Unbind the socket from the endpoint */ rc = xs_shutdown (socket, id); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBxs_connect\fR(3) \fBxs_bind\fR(3) \fBxs\fR(7) .SH "AUTHORS" .sp This manual page was written by Martin Sustrik <\m[blue]\fBsustrik@250bpm\&.com\fR\m[]\&\s-2\u[1]\d\s+2>\&. .SH "NOTES" .IP " 1." 4 sustrik@250bpm.com .RS 4 \%mailto:sustrik@250bpm.com .RE