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