$pref::Net

consoledoc.h

More...

Public Variables

int

How long between received packets before the client is considered as lagging (in ms).

int

Sets how often packets are sent from the server to a client.

int

Sets how often packets are sent from the client to the server.

int

Sets the maximum size in bytes an individual network packet may be.

Detailed Description

Public Variables

int LagThreshold 

How long between received packets before the client is considered as lagging (in ms).

This is used by GameConnection to determine if the client is lagging. If the client is indeed lagging, setLagIcon() is called to inform the user in some way. i.e. display an icon on screen.

int PacketRateToClient 

Sets how often packets are sent from the server to a client.

It is possible to control how often packets may be sent to the clients. This may be used to throttle the amount of bandwidth being used, but should be adjusted with caution.

The actual formula used to calculate the delay between sending packets to a client is:

Packet Update Delay To Client = 1024 / $pref::Net::PacketRateToClient
with the result in ms. A minimum rate of 1 is enforced in the source code. The default value is 10.

note:

When using a local connection (local_connections) be aware that this variable is always forced to 128.

int PacketRateToServer 

Sets how often packets are sent from the client to the server.

It is possible to control how often packets may be sent to the server. This may be used to throttle the amount of bandwidth being used, but should be adjusted with caution.

The actual formula used to calculate the delay between sending packets to the server is:

Packet Update Delay To Server = 1024 / $pref::Net::PacketRateToServer
with the result in ms. A minimum rate of 8 is enforced in the source code. The default value is 32.

note:

When using a local connection (local_connections) be aware that this variable is always forced to 128.

int PacketSize 

Sets the maximum size in bytes an individual network packet may be.

It is possible to control how large each individual network packet may be. Increasing its size from the default allows for more data to be sent on each network send. However, this value should be changed with caution as too large a value will cause packets to be split up by the networking platform or hardware, which is something Torque cannot handle.

A minimum packet size of 100 bytes is enforced in the source code. There is no enforced maximum. The default value is 200 bytes.

note:

When using a local connection (local_connections) be aware that this variable is always forced to 1024 bytes.