diff options
author | Justin Clark-Casey (justincc) | 2011-12-08 21:45:02 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-12-08 21:45:02 +0000 |
commit | 32d0ef89c6fbaf14e669e9dd3a8508bc817fbd52 (patch) | |
tree | 8cd3e37ea48bb5116d1441bde897e00533805b5d /OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |
parent | Add OpenSim.Region.ClientStack.LindenUDP.Tests.dll back into the test suite (diff) | |
download | opensim-SC-32d0ef89c6fbaf14e669e9dd3a8508bc817fbd52.zip opensim-SC-32d0ef89c6fbaf14e669e9dd3a8508bc817fbd52.tar.gz opensim-SC-32d0ef89c6fbaf14e669e9dd3a8508bc817fbd52.tar.bz2 opensim-SC-32d0ef89c6fbaf14e669e9dd3a8508bc817fbd52.tar.xz |
Extend TestAddClient() to check that the first packet received is an ack packet
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index ac21805..cef5f74 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -328,7 +328,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
328 | /// The method to call if the packet is not acked by the client. If null, then a standard | 328 | /// The method to call if the packet is not acked by the client. If null, then a standard |
329 | /// resend of the packet is done. | 329 | /// resend of the packet is done. |
330 | /// </param> | 330 | /// </param> |
331 | public void SendPacket( | 331 | public virtual void SendPacket( |
332 | LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting, UnackedPacketMethod method) | 332 | LLUDPClient udpClient, Packet packet, ThrottleOutPacketType category, bool allowSplitting, UnackedPacketMethod method) |
333 | { | 333 | { |
334 | // CoarseLocationUpdate packets cannot be split in an automated way | 334 | // CoarseLocationUpdate packets cannot be split in an automated way |
@@ -928,6 +928,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
928 | // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); | 928 | // buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); |
929 | } | 929 | } |
930 | 930 | ||
931 | /// <summary> | ||
932 | /// Send an ack immediately to the given endpoint. | ||
933 | /// </summary> | ||
934 | /// <remarks> | ||
935 | /// FIXME: Might be possible to use SendPacketData() like everything else, but this will require refactoring so | ||
936 | /// that we can obtain the UDPClient easily at this point. | ||
937 | /// </remarks> | ||
938 | /// <param name="remoteEndpoint"></param> | ||
939 | /// <param name="sequenceNumber"></param> | ||
931 | private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) | 940 | private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) |
932 | { | 941 | { |
933 | PacketAckPacket ack = new PacketAckPacket(); | 942 | PacketAckPacket ack = new PacketAckPacket(); |
@@ -936,6 +945,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
936 | ack.Packets[0] = new PacketAckPacket.PacketsBlock(); | 945 | ack.Packets[0] = new PacketAckPacket.PacketsBlock(); |
937 | ack.Packets[0].ID = sequenceNumber; | 946 | ack.Packets[0].ID = sequenceNumber; |
938 | 947 | ||
948 | SendAckImmediate(remoteEndpoint, ack); | ||
949 | } | ||
950 | |||
951 | public virtual void SendAckImmediate(IPEndPoint remoteEndpoint, PacketAckPacket ack) | ||
952 | { | ||
939 | byte[] packetData = ack.ToBytes(); | 953 | byte[] packetData = ack.ToBytes(); |
940 | int length = packetData.Length; | 954 | int length = packetData.Length; |
941 | 955 | ||