libzmq master
The Intelligent Transport Layer

options.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright (c) 2009-2011 250bpm s.r.o.
00003     Copyright (c) 2007-2009 iMatix Corporation
00004     Copyright (c) 2011 VMware, Inc.
00005     Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
00006 
00007     This file is part of 0MQ.
00008 
00009     0MQ is free software; you can redistribute it and/or modify it under
00010     the terms of the GNU Lesser General Public License as published by
00011     the Free Software Foundation; either version 3 of the License, or
00012     (at your option) any later version.
00013 
00014     0MQ is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00021 */
00022 
00023 #ifndef __ZMQ_OPTIONS_HPP_INCLUDED__
00024 #define __ZMQ_OPTIONS_HPP_INCLUDED__
00025 
00026 #include "stddef.h"
00027 #include "stdint.hpp"
00028 
00029 namespace zmq
00030 {
00031 
00032     struct options_t
00033     {
00034         options_t ();
00035 
00036         int setsockopt (int option_, const void *optval_, size_t optvallen_);
00037         int getsockopt (int option_, void *optval_, size_t *optvallen_);
00038 
00039         //  High-water marks for message pipes.
00040         int sndhwm;
00041         int rcvhwm;
00042 
00043         //  I/O thread affinity.
00044         uint64_t affinity;
00045 
00046         //  Socket identity
00047         unsigned char identity_size;
00048         unsigned char identity [256];
00049 
00050         //  Maximum tranfer rate [kb/s]. Default 100kb/s.
00051         int rate;
00052 
00053         //  Reliability time interval [ms]. Default 10 seconds.
00054         int recovery_ivl;
00055 
00056         // Sets the time-to-live field in every multicast packet sent.
00057         int multicast_hops;
00058 
00059         // SO_SNDBUF and SO_RCVBUF to be passed to underlying transport sockets.
00060         int sndbuf;
00061         int rcvbuf;
00062 
00063         //  Socket type.
00064         int type;
00065 
00066         //  Linger time, in milliseconds.
00067         int linger;
00068 
00069         //  Minimum interval between attempts to reconnect, in milliseconds.
00070         //  Default 100ms
00071         int reconnect_ivl;
00072 
00073         //  Maximum interval between attempts to reconnect, in milliseconds.
00074         //  Default 0 (unused)
00075         int reconnect_ivl_max;
00076 
00077         //  Maximum backlog for pending connections.
00078         int backlog;
00079 
00080         //  Maximal size of message to handle.
00081         int64_t maxmsgsize;
00082 
00083         // The timeout for send/recv operations for this socket.
00084         int rcvtimeo;
00085         int sndtimeo;
00086 
00087         //  If 1, indicates the use of IPv4 sockets only, it will not be
00088         //  possible to communicate with IPv6-only hosts. If 0, the socket can
00089         //  connect to and accept connections from both IPv4 and IPv6 hosts.
00090         int ipv4only;
00091 
00092         //  If true, session reads all the pending messages from the pipe and
00093         //  sends them to the network when socket is closed.
00094         bool delay_on_close;
00095 
00096         //  If true, socket reads all the messages from the pipe and delivers
00097         //  them to the user when the peer terminates.
00098         bool delay_on_disconnect;
00099 
00100         //  If 1, (X)SUB socket should filter the messages. If 0, it should not.
00101         bool filter;
00102 
00103         //  Sends identity to all new connections.
00104         bool send_identity;
00105 
00106         //  Receivers identity from all new connections.
00107         bool recv_identity;
00108     };
00109 
00110 }
00111 
00112 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines