@@ -29,7 +29,9 @@ The following options are supported.
--ddp
--primaryadvertised
--altadvertised
--threading THREADCOUNT
--configfile
--reuseaddr
--help
Details of each option are as follows.
...
...
@@ -186,6 +188,14 @@ For more details, visit www.stunprotocol.org for details on how to correctly set
____
**--threading** THREADCOUNT
The --threading switch specifies the number of threads to use per socket. If 0 is specified for THREADCOUNT, this indicates the default mode, which is
that all sockets share a single thread. This is the recommended value for most scenarios. Specifying a higher number of threads is useful in scenarios where a single
core is not sufficient to process the entire network load.
____
**--configfile** FILENAME
The --configfile switch allows the server to be configured with a JSON configuration file rather
// deliberately not checking for 0. Ok to allocate a 0 byte array
std::vector<uint8_t>spAlloc(size+2);// add two bytes for null termination (makes debugging ascii and unicode strings easier), but these two bytes are invisible to the caller (not included in _allocatedSize)
_spAllocation.swap(spAlloc);
spAlloc.clear();
_data=_spAllocation.data();
if(_data)
{
_data[size]=0;
_data[size+1]=0;
}
_size=(_data!=nullptr)?size:0;
// deliberately not checking for 0. Ok to allocate a 0 byte array.
// Plus two bytes for null termination (useful for debugging strings)