15 #include "config_net.h"
17 #include "netDatagram.h"
18 #include "pandaSystem.h"
22 Configure(config_net);
23 NotifyCategoryDef(net,
"");
25 ConfigureFn(config_net) {
39 get_net_max_write_queue() {
44 (
"net-max-write-queue", 10000,
45 PRC_DESC(
"This limits the number of datagrams in a ConnectionWriter's "
49 return *net_max_write_queue;
53 get_net_max_response_queue() {
58 (
"net-max-response-queue", 50000,
59 PRC_DESC(
"This limits the number of datagrams, messages, what have you, "
60 "in the various QueuedConnectionReader, QueuedConnectionListener, "
61 "and QueuedConnectionManager classes."));
64 return *net_max_response_queue;
68 get_net_error_abort() {
73 (
"net-error-abort",
false);
76 return *net_error_abort;
80 get_net_max_poll_cycle() {
85 (
"net-max-poll-cycle", 0.2,
86 PRC_DESC(
"Specifies the maximum amount of time, in seconds, to "
87 "continue to read data within one cycle of the poll() "
88 "call. If this is negative, the program will wait as "
89 "long as data is available to be read. Setting this to "
90 "a reasonable value prevents poll() from completely "
91 "starving the rest of the application when data is coming "
92 "in faster than it can be processed."));
95 return *net_max_poll_cycle;
104 (
"net-max-block", 0.01,
105 PRC_DESC(
"Specifies the maximum amount of time, in seconds, to "
106 "completely block the process during any blocking wait "
107 "in the net subsystem. This is an internal timeout only, "
108 "and gives the net subsystem a chance to detect things "
109 "like explicitly-closed connections in another thread; it "
110 "does not affect the blocking behavior at the high "
114 return *net_max_block;
120 make_thread_name(
const string &thread_name,
int thread_index) {
122 stream << thread_name <<
"_" << thread_index;
128 (
"net-max-read-per-epoch", 1024,
129 PRC_DESC(
"The maximum number of bytes to read from the net in a single "
130 "thread epoch, when SIMPLE_THREADS is defined. This is designed "
131 "to minimize the impact of the networking layer on the other "
135 (
"net-max-write-per-epoch", 1024,
136 PRC_DESC(
"The maximum number of bytes to write to the net in a single "
137 "thread epoch, when SIMPLE_THREADS is defined. This is designed "
138 "to minimize the impact of the networking layer on the other "
142 (
"net-thread-priority", TP_low,
143 PRC_DESC(
"The default thread priority when creating threaded readers "
157 static bool initialized =
false;
163 NetDatagram::init_type();
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
This class is used as a namespace to group several global properties of Panda.
This is a convenience class to specialize ConfigVariable as a boolean type.
void add_system(const string &system)
Intended for use by each subsystem to register itself at startup.
This is a convenience class to specialize ConfigVariable as a floating-point type.
This class specializes ConfigVariable as an enumerated type.
This is a convenience class to specialize ConfigVariable as an integer type.