Merge pull request #264 from ianbarber/master

Update docs for last endpoint and add test for IPC last endpoint retrieval
This commit is contained in:
Chuck Remes 2012-02-19 12:30:37 -08:00
commit 78d24d3d01
2 changed files with 9 additions and 1 deletions

View File

@ -395,7 +395,8 @@ ZMQ_LAST_ENDPOINT: Retrieve the last endpoint set
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The 'ZMQ_LAST_ENDPOINT' option shall retrieve the last endpoint bound for
TCP and IPC transports. The returned value will be a string in the form of
a ZMQ DSN.
a ZMQ DSN. Note that if the TCP host is INADDR_ANY, indicated by a *, then
the returned address will be 0.0.0.0 (for IPv4).
[horizontal]
Option value type:: character string

View File

@ -47,6 +47,13 @@ int main (int argc, char *argv [])
rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, test, &siz);
assert (rc == 0 && strcmp (test, "tcp://127.0.0.1:54321") == 0);
rc = zmq_bind (sb, "ipc:///tmp/testep");
assert (rc == 0);
siz = 255;
rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, test, &siz);
assert (rc == 0 && strcmp (test, "ipc:///tmp/testep") == 0);
return 0 ;
}