OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
OpenSim.Region.ClientStack.LindenUDP.LLUDPServer Class Reference

The LLUDP server for a region. This handles incoming and outgoing packets for all UDP connections to the region More...

Inheritance diagram for OpenSim.Region.ClientStack.LindenUDP.LLUDPServer:
Inheritance graph
[legend]
Collaboration diagram for OpenSim.Region.ClientStack.LindenUDP.LLUDPServer:
Collaboration graph
[legend]

Classes

class  PacketLogger
 

Public Member Functions

 LLUDPServer (IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager)
 
void Start ()
 
void StartInbound ()
 
override void StartOutbound ()
 Start outbound UDP packet handling. More...
 
void Stop ()
 
override bool EnablePools ()
 
override bool DisablePools ()
 
void AddScene (IScene scene)
 
bool HandlesRegion (Location x)
 
int GetTotalQueuedOutgoingPackets ()
 
virtual void SendPacket (LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting, UnackedPacketMethod method)
 Start the process of sending a packet to the client. More...
 
bool SendPacketData (LLUDPClient udpClient, byte[] data, PacketType type, ThrottleOutPacketType category, UnackedPacketMethod method)
 Start the process of sending a packet to the client. More...
 
void SendAcks (LLUDPClient udpClient)
 
void SendPing (LLUDPClient udpClient)
 
void CompletePing (LLUDPClient udpClient, byte pingID)
 
void HandleUnacked (LLClientView client)
 
void ResendUnacked (OutgoingPacket outgoingPacket)
 
void Flush (LLUDPClient udpClient)
 
override void PacketReceived (UDPPacketBuffer buffer)
 This method is called when an incoming packet is received More...
 
virtual void SendAckImmediate (IPEndPoint remoteEndpoint, PacketAckPacket ack)
 
- Public Member Functions inherited from OpenMetaverse.OpenSimUDPBase
 OpenSimUDPBase (IPAddress bindAddress, int port)
 Default constructor More...
 
virtual void StartInbound (int recvBufferSize, bool asyncPacketHandling)
 Start inbound UDP packet handling. More...
 
virtual void StopInbound ()
 
virtual void StopOutbound ()
 
void AsyncBeginSend (UDPPacketBuffer buf)
 

Static Public Member Functions

static void LogPacketHeader (bool incoming, uint circuit, byte flags, PacketType packetType, ushort size)
 

Public Attributes

const int MTU = 1400
 Maximum transmission unit, or UDP packet size, for the LLUDP protocol More...
 
readonly float TickCountResolution
 The measured resolution of Environment.TickCount More...
 
readonly int PrimUpdatesPerCallback
 Number of prim updates to put on the queue each time the OnQueueEmpty event is triggered for updates More...
 
readonly int TextureSendLimit
 Number of texture packets to put on the queue each time the OnQueueEmpty event is triggered for textures More...
 

Static Public Attributes

static PacketLogger PacketLog
 

Protected Member Functions

virtual IClientAPI AddClient (uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
 Add a client. More...
 
void ClientOutgoingPacketHandler (IClientAPI client)
 
void LogoutHandler (IClientAPI client)
 

Protected Attributes

bool m_resendUnacked
 Flag to signal when clients should check for resends More...
 
bool m_sendAcks
 Flag to signal when clients should send ACKs More...
 
bool m_sendPing
 Flag to signal when clients should send pings More...
 
- Protected Attributes inherited from OpenMetaverse.OpenSimUDPBase
int m_udpPort
 UDP port to bind to in server mode More...
 
IPAddress m_localBindAddress
 Local IP address to bind to in server mode More...
 

Static Protected Attributes

static bool m_shouldCollectStats = false
 

Properties

int ClientLogoutsDueToNoReceives [get, set]
 Number of forced client logouts due to no receipt of packets before timeout. More...
 
int DefaultClientPacketDebugLevel [get, set]
 Default packet debug level given to new clients More...
 
bool DiscardInboundAgentUpdates [get, set]
 If set then all inbound agent updates are discarded. For debugging purposes. discard agent update. More...
 
TokenBucket Throttle [get, set]
 Bandwidth throttle for this UDP server More...
 
ThrottleRates ThrottleRates [get, set]
 Per client throttle rates enforced by this server More...
 
Scene Scene [get, set]
 Reference to the scene this UDP server is attached to More...
 
int NextAnimationSequenceNumber [get]
 
Socket Server [get]
 
int IncomingMalformedPacketCount [get, set]
 Record how many inbound packets could not be recognized as LLUDP packets. More...
 
int IncomingOrphanedPacketCount [get, set]
 Record how many inbound packets could not be associated with a simulator circuit. More...
 
JobEngine IpahEngine [get, set]
 Queue some low priority but potentially high volume async requests so that they don't overwhelm available threadpool threads. More...
 
JobEngine OqrEngine [get, set]
 Run queue empty processing within a single persistent thread. More...
 
static long AggregatedLLUDPBytesIn [get]
 
static long AggregatedLLUDPBytesOut [get]
 
long IncomingPacketsProcessed [get, set]
 Number of inbound packets processed since startup. More...
 
- Properties inherited from OpenMetaverse.OpenSimUDPBase
bool UsePools [get, set]
 Are we to use object pool(s) to reduce memory churn when receiving data? More...
 
OpenSim.Framework.Pool
< UDPPacketBuffer > 
Pool [get, set]
 Pool to use for handling data. May be null if UsePools = false; More...
 
bool IsRunningInbound [get, set]
 Returns true if the server is currently listening for inbound packets, otherwise false More...
 
bool IsRunningOutbound [get, set]
 Returns true if the server is currently sending outbound packets, otherwise false More...
 
int UdpReceives [get, set]
 Number of UDP receives. More...
 
int UdpSends [get, set]
 Number of UDP sends More...
 
float AverageReceiveTicksForLastSamplePeriod [get, set]
 The average time taken for each require receive in the last sample. More...
 

Detailed Description

The LLUDP server for a region. This handles incoming and outgoing packets for all UDP connections to the region

Definition at line 252 of file LLUDPServer.cs.

Constructor & Destructor Documentation

OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.LLUDPServer ( IPAddress  listenIP,
ref uint  port,
int  proxyPortOffsetParm,
bool  allow_alternate_port,
IConfigSource  configSource,
AgentCircuitManager  circuitManager 
)
inline

Definition at line 445 of file LLUDPServer.cs.

Member Function Documentation

virtual IClientAPI OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.AddClient ( uint  circuitCode,
UUID  agentID,
UUID  sessionID,
IPEndPoint  remoteEndPoint,
AuthenticateResponse  sessionInfo 
)
inlineprotectedvirtual

Add a client.

Parameters
circuitCode
agentID
sessionID
remoteEndPoint
sessionInfo
Returns
The client if it was added. Null if the client already existed.

Definition at line 1941 of file LLUDPServer.cs.

Here is the call graph for this function:

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.AddScene ( IScene  scene)
inline

Definition at line 683 of file LLUDPServer.cs.

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.ClientOutgoingPacketHandler ( IClientAPI  client)
inlineprotected

Definition at line 2146 of file LLUDPServer.cs.

Here is the call graph for this function:

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.CompletePing ( LLUDPClient  udpClient,
byte  pingID 
)
inline

Definition at line 1074 of file LLUDPServer.cs.

override bool OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.DisablePools ( )
inlinevirtual

Reimplemented from OpenMetaverse.OpenSimUDPBase.

Definition at line 598 of file LLUDPServer.cs.

override bool OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.EnablePools ( )
inlinevirtual

Reimplemented from OpenMetaverse.OpenSimUDPBase.

Definition at line 584 of file LLUDPServer.cs.

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.Flush ( LLUDPClient  udpClient)
inline

Definition at line 1143 of file LLUDPServer.cs.

int OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.GetTotalQueuedOutgoingPackets ( )
inline

Definition at line 832 of file LLUDPServer.cs.

Here is the call graph for this function:

bool OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.HandlesRegion ( Location  x)
inline

Definition at line 827 of file LLUDPServer.cs.

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.HandleUnacked ( LLClientView  client)
inline

Definition at line 1081 of file LLUDPServer.cs.

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.LogoutHandler ( IClientAPI  client)
inlineprotected

Definition at line 2337 of file LLUDPServer.cs.

static void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.LogPacketHeader ( bool  incoming,
uint  circuit,
byte  flags,
PacketType  packetType,
ushort  size 
)
inlinestatic

Definition at line 1594 of file LLUDPServer.cs.

override void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.PacketReceived ( UDPPacketBuffer  buffer)
inlinevirtual

This method is called when an incoming packet is received

Parameters
bufferIncoming packet buffer

Implements OpenMetaverse.OpenSimUDPBase.

Definition at line 1253 of file LLUDPServer.cs.

Here is the call graph for this function:

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.ResendUnacked ( OutgoingPacket  outgoingPacket)
inline

Definition at line 1126 of file LLUDPServer.cs.

Here is the call graph for this function:

virtual void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.SendAckImmediate ( IPEndPoint  remoteEndpoint,
PacketAckPacket  ack 
)
inlinevirtual

Reimplemented in OpenSim.Tests.Common.TestLLUDPServer.

Definition at line 1909 of file LLUDPServer.cs.

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.SendAcks ( LLUDPClient  udpClient)
inline

Definition at line 1035 of file LLUDPServer.cs.

virtual void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.SendPacket ( LLUDPClient  udpClient,
Packet  packet,
ThrottleOutPacketType  category,
bool  allowSplitting,
UnackedPacketMethod  method 
)
inlinevirtual

Start the process of sending a packet to the client.

Parameters
udpClient
packet
category
allowSplitting
methodThe method to call if the packet is not acked by the client. If null, then a standard resend of the packet is done.

WRONG use. May be usefull in future revision

Reimplemented in OpenSim.Tests.Common.TestLLUDPServer.

Definition at line 899 of file LLUDPServer.cs.

bool OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.SendPacketData ( LLUDPClient  udpClient,
byte[]  data,
PacketType  type,
ThrottleOutPacketType  category,
UnackedPacketMethod  method 
)
inline

Start the process of sending a packet to the client.

Parameters
udpClient
data
type
category
methodThe method to call if the packet is not acked by the client. If null, then a standard resend of the packet is done.
Returns
true if the data was sent immediately, false if it was queued for sending

Definition at line 949 of file LLUDPServer.cs.

Here is the call graph for this function:

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.SendPing ( LLUDPClient  udpClient)
inline

Definition at line 1061 of file LLUDPServer.cs.

Here is the call graph for this function:

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.Start ( )
inline

Definition at line 530 of file LLUDPServer.cs.

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.StartInbound ( )
inline

Definition at line 540 of file LLUDPServer.cs.

override void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.StartOutbound ( )
inlinevirtual

Start outbound UDP packet handling.

Reimplemented from OpenMetaverse.OpenSimUDPBase.

Definition at line 559 of file LLUDPServer.cs.

void OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.Stop ( )
inline

Definition at line 575 of file LLUDPServer.cs.

Member Data Documentation

bool OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.m_resendUnacked
protected

Flag to signal when clients should check for resends

Definition at line 339 of file LLUDPServer.cs.

bool OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.m_sendAcks
protected

Flag to signal when clients should send ACKs

Definition at line 342 of file LLUDPServer.cs.

bool OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.m_sendPing
protected

Flag to signal when clients should send pings

Definition at line 345 of file LLUDPServer.cs.

bool OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.m_shouldCollectStats = false
staticprotected

Definition at line 1573 of file LLUDPServer.cs.

const int OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.MTU = 1400

Maximum transmission unit, or UDP packet size, for the LLUDP protocol

Definition at line 257 of file LLUDPServer.cs.

PacketLogger OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.PacketLog
static

Definition at line 1571 of file LLUDPServer.cs.

readonly int OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.PrimUpdatesPerCallback

Number of prim updates to put on the queue each time the OnQueueEmpty event is triggered for updates

Definition at line 278 of file LLUDPServer.cs.

readonly int OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.TextureSendLimit

Number of texture packets to put on the queue each time the OnQueueEmpty event is triggered for textures

Definition at line 282 of file LLUDPServer.cs.

readonly float OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.TickCountResolution

The measured resolution of Environment.TickCount

Definition at line 274 of file LLUDPServer.cs.

Property Documentation

long OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.AggregatedLLUDPBytesIn
staticget

Definition at line 1586 of file LLUDPServer.cs.

long OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.AggregatedLLUDPBytesOut
staticget

Definition at line 1590 of file LLUDPServer.cs.

int OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.ClientLogoutsDueToNoReceives
getset

Number of forced client logouts due to no receipt of packets before timeout.

Definition at line 260 of file LLUDPServer.cs.

int OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.DefaultClientPacketDebugLevel
getset

Default packet debug level given to new clients

Definition at line 265 of file LLUDPServer.cs.

bool OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.DiscardInboundAgentUpdates
getset

If set then all inbound agent updates are discarded. For debugging purposes. discard agent update.

Definition at line 271 of file LLUDPServer.cs.

int OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.IncomingMalformedPacketCount
getset

Record how many inbound packets could not be recognized as LLUDP packets.

Definition at line 412 of file LLUDPServer.cs.

int OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.IncomingOrphanedPacketCount
getset

Record how many inbound packets could not be associated with a simulator circuit.

Definition at line 417 of file LLUDPServer.cs.

long OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.IncomingPacketsProcessed
getset

Number of inbound packets processed since startup.

Definition at line 2202 of file LLUDPServer.cs.

JobEngine OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.IpahEngine
getset

Queue some low priority but potentially high volume async requests so that they don't overwhelm available threadpool threads.

Definition at line 433 of file LLUDPServer.cs.

int OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.NextAnimationSequenceNumber
get

Definition at line 350 of file LLUDPServer.cs.

JobEngine OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.OqrEngine
getset

Run queue empty processing within a single persistent thread.

This is the alternative to having every connection schedule its own job in the threadpool which causes performance problems when there are many connections.

Definition at line 443 of file LLUDPServer.cs.

Scene OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.Scene
getset

Reference to the scene this UDP server is attached to

Definition at line 306 of file LLUDPServer.cs.

Socket OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.Server
get

Definition at line 392 of file LLUDPServer.cs.

TokenBucket OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.Throttle
getset

Bandwidth throttle for this UDP server

Definition at line 292 of file LLUDPServer.cs.

ThrottleRates OpenSim.Region.ClientStack.LindenUDP.LLUDPServer.ThrottleRates
getset

Per client throttle rates enforced by this server

If the total rate is non-zero, then this is the maximum total throttle setting that any client can ever have. The other rates (resend, asset, etc.) are the defaults for a new client and can be changed (and usually do get changed immediately). They do not need to sum to the total.

Definition at line 300 of file LLUDPServer.cs.


The documentation for this class was generated from the following file: