21 #if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_NET) 22 #error Buildsystem error: BUILDING_PANDA_NET not defined 25 Configure(config_net);
26 NotifyCategoryDef(net,
"");
28 ConfigureFn(config_net) {
42 get_net_max_write_queue() {
45 if (net_max_write_queue ==
nullptr) {
47 (
"net-max-write-queue", 10000,
48 PRC_DESC(
"This limits the number of datagrams in a ConnectionWriter's " 52 return *net_max_write_queue;
56 get_net_max_response_queue() {
59 if (net_max_response_queue ==
nullptr) {
61 (
"net-max-response-queue", 50000,
62 PRC_DESC(
"This limits the number of datagrams, messages, what have you, " 63 "in the various QueuedConnectionReader, QueuedConnectionListener, " 64 "and QueuedConnectionManager classes."));
67 return *net_max_response_queue;
71 get_net_error_abort() {
74 if (net_error_abort ==
nullptr) {
76 (
"net-error-abort",
false);
79 return *net_error_abort;
83 get_net_max_poll_cycle() {
86 if (net_max_poll_cycle ==
nullptr) {
88 (
"net-max-poll-cycle", 0.2,
89 PRC_DESC(
"Specifies the maximum amount of time, in seconds, to " 90 "continue to read data within one cycle of the poll() " 91 "call. If this is negative, the program will wait as " 92 "long as data is available to be read. Setting this to " 93 "a reasonable value prevents poll() from completely " 94 "starving the rest of the application when data is coming " 95 "in faster than it can be processed."));
98 return *net_max_poll_cycle;
102 get_net_max_block() {
105 if (net_max_block ==
nullptr) {
107 (
"net-max-block", 0.01,
108 PRC_DESC(
"Specifies the maximum amount of time, in seconds, to " 109 "completely block the process during any blocking wait " 110 "in the net subsystem. This is an internal timeout only, " 111 "and gives the net subsystem a chance to detect things " 112 "like explicitly-closed connections in another thread; it " 113 "does not affect the blocking behavior at the high " 117 return *net_max_block;
123 make_thread_name(
const std::string &thread_name,
int thread_index) {
124 std::ostringstream stream;
125 stream << thread_name <<
"_" << thread_index;
131 (
"net-max-read-per-epoch", 1024,
132 PRC_DESC(
"The maximum number of bytes to read from the net in a single " 133 "thread epoch, when SIMPLE_THREADS is defined. This is designed " 134 "to minimize the impact of the networking layer on the other " 138 (
"net-max-write-per-epoch", 1024,
139 PRC_DESC(
"The maximum number of bytes to write to the net in a single " 140 "thread epoch, when SIMPLE_THREADS is defined. This is designed " 141 "to minimize the impact of the networking layer on the other " 145 (
"net-thread-priority", TP_low,
146 PRC_DESC(
"The default thread priority when creating threaded readers " 158 static bool initialized =
false;
164 NetDatagram::init_type();
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
void init_libnet()
Initializes the library.
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.
This is a convenience class to specialize ConfigVariable as a floating- point type.
This class specializes ConfigVariable as an enumerated type.
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a convenience class to specialize ConfigVariable as an integer type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.