ZeroMQ接口函數之 :zmq_disconnect - 斷開一個socket的連接


ZeroMQ 官方地址 :http://api.zeromq.org/4-0:zmq_disconnect

zmq_disconnect(3)     ØMQ Manual - ØMQ/3.2.5

Name

zmq_disconnect - 斷開一個socket的連接

Synopsis

int zmq_disconnect (void *socket, const char *endpoint);

Description

函數zmq_disconnect() 會斷開socket參數指定的socket與endpoint參數指定的終結點的連接。

endpoint參數和在zmq_connect(3)函數中有詳細描述。

Return value

如果zmq_disconnect()函數執行成功,則返回0。否則返回 -1,並設置errno為下列指定值。

Errors

  EINVAL

    參數endpoint指定的終結點不可用。

  ETERM 

    和當前soocket相聯系的context被終結了。

  ENOTSOCK

    參數socket不可用。

  ENOENT

    socket並沒有連接參數endpoint的終結點。

Example

用一個scoket連接廣播、進程內和TCP連接。

1 /* Create a ZMQ_SUB socket */
2 void *socket = zmq_socket (context, ZMQ_SUB); 3 assert (socket); 4 /* Connect it to the host server001, port 5555 using a TCP transport */
5 rc = zmq_connect (socket, "tcp://server001:5555"); 6 assert (rc == 0); 7 /* Disconnect from the previously connected endpoint */
8 rc = zmq_disconnect (socket, "tcp://server001:5555"); assert (rc == 0);

See also

zmq_connect(3)  zmq_socket(3)  zmq(7)

Authors

This ØMQ manual page was written by Martin Sustrik <sustrik@250bpm.com>, Martin Lucina

<mato@kotelna.sk> and Ian Barber <ian.barber@gmail.com>

 

Web site design and content is copyright (c) 2007-2012 iMatix Corporation. Contact us for professional support. Site content licensed under the Creative Commons Attribution-Share Alike 3.0 License. ØMQ is copyright (c) Copyright (c) 2007-2012 iMatix Corporation and Contributors. ØMQ is free software licensed under the LGPL. ØMQ, ZeroMQ, and 0MQ are trademarks of iMatix Corporation. Terms of Use — Privacy

Policy

 

更多 ZeroMQ APIhttp://www.cnblogs.com/fengbohello/p/4230135.html

 

翻譯:風波

mail : fengbohello@qq.com

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM