From f79a50062147b50f47e61f4a4162d6f01e590d34 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 18 Dec 2007 12:33:29 +0000 Subject: [PATCH] * Sakai appears to be having some sort of socket error that we've not accounted for. We're going to assume that our endpoint is okay and continue reading. --- OpenSim/Region/ClientStack/UDPServer.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index 64381b446d..f91e5e2eb4 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -120,6 +120,7 @@ namespace OpenSim.Region.ClientStack case SocketError.AlreadyInProgress: case SocketError.NetworkReset: case SocketError.ConnectionReset: + try { CloseEndPoint(epSender); @@ -154,6 +155,23 @@ namespace OpenSim.Region.ClientStack { //MainLog.Instance.Verbose("UDPSERVER", a.ToString()); } + try + { + Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); + + // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. + // so therefore.. we've got to tell the server to BeginReceiveFrom again. + // This will happen over and over until we've gone through all packets + // sent to and from this particular user. + // Stupid I know.. + // but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method. + + } + catch (SocketException) + { + + } + // Here's some reference code! :D // Shutdown and restart the UDP listener! hehe // Shiny