PageRenderTime 30ms CodeModel.GetById 8ms RepoModel.GetById 0ms app.codeStats 0ms

/deimos/zsockopt.d

http://github.com/1100110/CZMQ
D | 161 lines | 111 code | 12 blank | 38 comment | 6 complexity | c6b59a8a2a91d202cc0422b4fca94f0d MD5 | raw file
  1. /* =========================================================================
  2. zsockopt - get/set 0MQ socket options
  3. GENERATED SOURCE CODE, DO NOT EDIT
  4. -------------------------------------------------------------------------
  5. Copyright (c) 1991-2011 iMatix Corporation <www.imatix.com>
  6. Copyright other contributors as noted in the AUTHORS file.
  7. This file is part of CZMQ, the high-level C binding for 0MQ:
  8. http://czmq.zeromq.org.
  9. This is free software; you can redistribute it and/or modify it under
  10. the terms of the GNU Lesser General Public License as published by
  11. the Free Software Foundation; either version 3 of the License, or (at
  12. your option) any later version.
  13. This software is distributed in the hope that it will be useful, but
  14. WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. Lesser General Public License for more details.
  17. You should have received a copy of the GNU Lesser General Public
  18. License along with this program. If not, see
  19. <http://www.gnu.org/licenses/>.
  20. =========================================================================
  21. */
  22. module zsockopt;
  23. import zmq;
  24. extern (C)
  25. {
  26. /// @interface
  27. //TODO make sure that this works....
  28. static if(ZMQ_VERSION_MAJOR == 2)
  29. {
  30. /// Get socket options
  31. int zsocket_hwm(void* socket);
  32. int zsocket_swap (void* socket);
  33. int zsocket_affinity (void* socket);
  34. int zsocket_rate (void* socket);
  35. int zsocket_recovery_ivl (void* socket);
  36. int zsocket_recovery_ivl_msec (void* socket);
  37. int zsocket_mcast_loop (void* socket);
  38. int zsocket_sndbuf (void* socket);
  39. int zsocket_rcvbuf (void* socket);
  40. int zsocket_linger (void* socket);
  41. int zsocket_reconnect_ivl (void* socket);
  42. int zsocket_reconnect_ivl_max (void* socket);
  43. int zsocket_backlog (void* socket);
  44. int zsocket_type (void* socket);
  45. int zsocket_rcvmore (void* socket);
  46. int zsocket_fd (void* socket);
  47. int zsocket_events (void* socket);
  48. /// Set socket options
  49. void zsocket_set_hwm (void* socket, int hwm);
  50. void zsocket_set_swap (void* socket, int swap);
  51. void zsocket_set_affinity (void* socket, int affinity);
  52. void zsocket_set_identity (void* socket, in char* identity);
  53. void zsocket_set_rate (void* socket, int rate);
  54. void zsocket_set_recovery_ivl (void* socket, int recovery_ivl);
  55. void zsocket_set_recovery_ivl_msec (void* socket, int recovery_ivl_msec);
  56. void zsocket_set_mcast_loop (void* socket, int mcast_loop);
  57. void zsocket_set_sndbuf (void* socket, int sndbuf);
  58. void zsocket_set_rcvbuf (void* socket, int rcvbuf);
  59. void zsocket_set_linger (void* socket, int linger);
  60. void zsocket_set_reconnect_ivl (void* socket, int reconnect_ivl);
  61. void zsocket_set_reconnect_ivl_max (void* socket, int reconnect_ivl_max);
  62. void zsocket_set_backlog (void* socket, int backlog);
  63. void zsocket_set_subscribe (void* socket, in char* subscribe);
  64. void zsocket_set_unsubscribe (void* socket, in char* unsubscribe);
  65. }
  66. static if(ZMQ_VERSION_MAJOR == 3)
  67. {
  68. /// Get socket options
  69. int zsocket_sndhwm (void* socket);
  70. int zsocket_rcvhwm (void* socket);
  71. int zsocket_affinity (void* socket);
  72. int zsocket_rate (void* socket);
  73. int zsocket_recovery_ivl (void* socket);
  74. int zsocket_sndbuf (void* socket);
  75. int zsocket_rcvbuf (void* socket);
  76. int zsocket_linger (void* socket);
  77. int zsocket_reconnect_ivl (void* socket);
  78. int zsocket_reconnect_ivl_max (void* socket);
  79. int zsocket_backlog (void* socket);
  80. int zsocket_maxmsgsize (void* socket);
  81. int zsocket_type (void* socket);
  82. int zsocket_rcvmore (void* socket);
  83. int zsocket_fd (void* socket);
  84. int zsocket_events (void* socket);
  85. /// Set socket options
  86. void zsocket_set_sndhwm (void* socket, int sndhwm);
  87. void zsocket_set_rcvhwm (void* socket, int rcvhwm);
  88. void zsocket_set_affinity (void* socket, int affinity);
  89. void zsocket_set_identity (void* socket, in char* identity);
  90. void zsocket_set_rate (void* socket, int rate);
  91. void zsocket_set_recovery_ivl (void* socket, int recovery_ivl);
  92. void zsocket_set_sndbuf (void* socket, int sndbuf);
  93. void zsocket_set_rcvbuf (void* socket, int rcvbuf);
  94. void zsocket_set_linger (void* socket, int linger);
  95. void zsocket_set_reconnect_ivl (void* socket, int reconnect_ivl);
  96. void zsocket_set_reconnect_ivl_max (void* socket, int reconnect_ivl_max);
  97. void zsocket_set_backlog (void* socket, int backlog);
  98. void zsocket_set_maxmsgsize (void* socket, int maxmsgsize);
  99. void zsocket_set_subscribe (void* socket, in char* subscribe);
  100. void zsocket_set_unsubscribe (void* socket, in char* unsubscribe);
  101. /// Emulation of widely-used 2.x socket options
  102. void zsocket_set_hwm (void* socket, int hwm);
  103. }
  104. static if(ZMQ_VERSION_MAJOR == 4)
  105. {
  106. /// Get socket options
  107. int zsocket_sndhwm (void* socket);
  108. int zsocket_rcvhwm (void* socket);
  109. int zsocket_affinity (void* socket);
  110. int zsocket_rate (void* socket);
  111. int zsocket_recovery_ivl (void* socket);
  112. int zsocket_sndbuf (void* socket);
  113. int zsocket_rcvbuf (void* socket);
  114. int zsocket_linger (void* socket);
  115. int zsocket_reconnect_ivl (void* socket);
  116. int zsocket_reconnect_ivl_max (void* socket);
  117. int zsocket_backlog (void* socket);
  118. int zsocket_maxmsgsize (void* socket);
  119. int zsocket_type (void* socket);
  120. int zsocket_rcvmore (void* socket);
  121. int zsocket_fd (void* socket);
  122. int zsocket_events (void* socket);
  123. /// Set socket options
  124. void zsocket_set_sndhwm (void* socket, int sndhwm);
  125. void zsocket_set_rcvhwm (void* socket, int rcvhwm);
  126. void zsocket_set_affinity (void* socket, int affinity);
  127. void zsocket_set_rate (void* socket, int rate);
  128. void zsocket_set_recovery_ivl (void* socket, int recovery_ivl);
  129. void zsocket_set_sndbuf (void* socket, int sndbuf);
  130. void zsocket_set_rcvbuf (void* socket, int rcvbuf);
  131. void zsocket_set_linger (void* socket, int linger);
  132. void zsocket_set_reconnect_ivl (void* socket, int reconnect_ivl);
  133. void zsocket_set_reconnect_ivl_max (void* socket, int reconnect_ivl_max);
  134. void zsocket_set_backlog (void* socket, int backlog);
  135. void zsocket_set_maxmsgsize (void* socket, int maxmsgsize);
  136. void zsocket_set_subscribe (void* socket, in char* subscribe);
  137. void zsocket_set_unsubscribe(void* socket, in char* unsubscribe);
  138. /// Emulation of widely-used 2.x socket options
  139. void zsocket_set_hwm (void* socket, int hwm);
  140. }
  141. /// Self test of this class
  142. int zsocket_test(bool verbose);
  143. /// @end
  144. }