libzmq master
The Intelligent Transport Layer

config.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) 2007-2011 Other contributors as noted in the AUTHORS file
00005 
00006     This file is part of 0MQ.
00007 
00008     0MQ is free software; you can redistribute it and/or modify it under
00009     the terms of the GNU Lesser General Public License as published by
00010     the Free Software Foundation; either version 3 of the License, or
00011     (at your option) any later version.
00012 
00013     0MQ is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public License
00019     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020 */
00021 
00022 #ifndef __ZMQ_CONFIG_HPP_INCLUDED__
00023 #define __ZMQ_CONFIG_HPP_INCLUDED__
00024 
00025 namespace zmq
00026 {
00027 
00028     //  Compile-time settings.
00029 
00030     enum 
00031     {
00032         //  Maximum number of sockets that can be opened at the same time.
00033         max_sockets = 512,
00034 
00035         //  Number of new messages in message pipe needed to trigger new memory
00036         //  allocation. Setting this parameter to 256 decreases the impact of
00037         //  memory allocation by approximately 99.6%
00038         message_pipe_granularity = 256,
00039 
00040         //  Commands in pipe per allocation event.
00041         command_pipe_granularity = 16,
00042 
00043         //  Determines how often does socket poll for new commands when it
00044         //  still has unprocessed messages to handle. Thus, if it is set to 100,
00045         //  socket will process 100 inbound messages before doing the poll.
00046         //  If there are no unprocessed messages available, poll is done
00047         //  immediately. Decreasing the value trades overall latency for more
00048         //  real-time behaviour (less latency peaks).
00049         inbound_poll_rate = 100,
00050 
00051         //  Maximal batching size for engines with receiving functionality.
00052         //  So, if there are 10 messages that fit into the batch size, all of
00053         //  them may be read by a single 'recv' system call, thus avoiding
00054         //  unnecessary network stack traversals.
00055         in_batch_size = 8192,
00056 
00057         //  Maximal batching size for engines with sending functionality.
00058         //  So, if there are 10 messages that fit into the batch size, all of
00059         //  them may be written by a single 'send' system call, thus avoiding
00060         //  unnecessary network stack traversals.
00061         out_batch_size = 8192,
00062 
00063         //  Maximal delta between high and low watermark.
00064         max_wm_delta = 1024,
00065 
00066         //  Maximum number of events the I/O thread can process in one go.
00067         max_io_events = 256,
00068 
00069         //  Maximal delay to process command in API thread (in CPU ticks).
00070         //  3,000,000 ticks equals to 1 - 2 milliseconds on current CPUs.
00071         //  Note that delay is only applied when there is continuous stream of
00072         //  messages to process. If not so, commands are processed immediately.
00073         max_command_delay = 3000000,
00074 
00075         //  Low-precision clock precision in CPU ticks. 1ms. Value of 1000000
00076         //  should be OK for CPU frequencies above 1GHz. If should work
00077         //  reasonably well for CPU frequencies above 500MHz. For lower CPU
00078         //  frequencies you may consider lowering this value to get best
00079         //  possible latencies.
00080         clock_precision = 1000000,
00081 
00082         //  Maximum transport data unit size for PGM (TPDU).
00083         pgm_max_tpdu = 1500,
00084 
00085         //  On some OSes the signaler has to be emulated using a TCP
00086         //  connection. In such cases following port is used.
00087         signaler_port = 5905
00088     };
00089 
00090 }
00091 
00092 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines