OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
/// <summary>
/// Start the process of sending a packet to the client.
/// </summary>
/// <param name="udpClient"></param>
/// <param name="packet"></param>
/// <param name="category"></param>
/// <param name="allowSplitting"></param>
/// <param name="method">
/// The method to call if the packet is not acked by the client.  If null, then a standard
/// resend of the packet is done.
/// </param>
Start the process of sending a packet to the client.
Start the process of sending a packet to the client .
public virtual void SendPacket(
            LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting, UnackedPacketMethod method)
        {
            if (packet.Type == PacketType.CoarseLocationUpdate && allowSplitting)
                allowSplitting = false;
            bool packetQueued = false;
            if (allowSplitting && packet.HasVariableBlocks)
            {
                byte[][] datas = packet.ToBytesMultiple();
                int packetCount = datas.Length;
                if (packetCount < 1)
                    m_log.Error("[LLUDPSERVER]: Failed to split " + packet.Type + " with estimated length " + packet.Length);
                for (int i = 0; i < packetCount; i++)
                {
                    byte[] data = datas[i];
                    if (!SendPacketData(udpClient, data, packet.Type, category, method))
                        packetQueued = true;
                }
            }
            else
            {
                byte[] data = packet.ToBytes();
                if (!SendPacketData(udpClient, data, packet.Type, category, method))
                    packetQueued = true;
            }
            PacketPool.Instance.ReturnPacket(packet);
            if (packetQueued)
                m_dataPresentEvent.Set();
        }
public virtual void SendPacket ( LLUDPClient udpClient , Packet packet , ThrottleOutPacketType category , bool allowSplitting , UnackedPacketMethod method ) { if ( packet . Type == PacketType . CoarseLocationUpdate && allowSplitting ) allowSplitting = false ; bool packetQueued = false ; if ( allowSplitting && packet . HasVariableBlocks ) { byte [ ] [ ] datas = packet . ToBytesMultiple ( ) ; int packetCount = datas . Length ; if ( packetCount < 1 ) m_log . Error ( " " + packet . Type + " " + packet . Length ) ; for ( int i = 0 ; i < packetCount ; i ++ ) { byte [ ] data = datas [ i ] ; if ( ! SendPacketData ( udpClient , data , packet . Type , category , method ) ) packetQueued = true ; } } else { byte [ ] data = packet . ToBytes ( ) ; if ( ! SendPacketData ( udpClient , data , packet . Type , category , method ) ) packetQueued = true ; } PacketPool . Instance . ReturnPacket ( packet ) ; if ( packetQueued ) m_dataPresentEvent . Set ( ) ; }
Start the process of sending a packet to the client.
Start the process of sending a packet to the client .
// CoarseLocationUpdate packets cannot be split in an automated way
udpClient
LLUDPClient
None
packet
Packet
None
category
ThrottleOutPacketType
None
allowSplitting
bool
None
method
UnackedPacketMethod
The method to call if the packet is not acked by the client.  If null, then a standard
resend of the packet is done.
The method to call if the packet is not acked by the client . If null then a standard resend of the packet is done .