mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 13:47:13 +01:00
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:
@@ -395,7 +395,8 @@ ZMQ_LAST_ENDPOINT: Retrieve the last endpoint set
|
|||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
The 'ZMQ_LAST_ENDPOINT' option shall retrieve the last endpoint bound for
|
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
|
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]
|
[horizontal]
|
||||||
Option value type:: character string
|
Option value type:: character string
|
||||||
|
|||||||
@@ -47,6 +47,13 @@ int main (int argc, char *argv [])
|
|||||||
rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, test, &siz);
|
rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, test, &siz);
|
||||||
assert (rc == 0 && strcmp (test, "tcp://127.0.0.1:54321") == 0);
|
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 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user