aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2008-10-19 17:02:39 +0000
committerTeravus Ovares2008-10-19 17:02:39 +0000
commited8a20dd602bd01d74e0bb1f6ad7c9419dfc4801 (patch)
tree06992117e4f2613249bd32715a4094a3781678fe
parentAdded calling cards. Fixes Mantis#2409 and part of #1515. (diff)
downloadopensim-SC-ed8a20dd602bd01d74e0bb1f6ad7c9419dfc4801.zip
opensim-SC-ed8a20dd602bd01d74e0bb1f6ad7c9419dfc4801.tar.gz
opensim-SC-ed8a20dd602bd01d74e0bb1f6ad7c9419dfc4801.tar.bz2
opensim-SC-ed8a20dd602bd01d74e0bb1f6ad7c9419dfc4801.tar.xz
* Fixed UDP server (again)
* Guys, there's an endless loop there *ON PURPOSE*. Please don't try to *fix* it. We must continue to process the UDP stream buffer on clients that disconnected nastily until it ends or the UDP server accept thread will die a horrible death.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 3648575..5ceea18 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -306,7 +306,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
306 } 306 }
307 catch (SocketException e) 307 catch (SocketException e)
308 { 308 {
309 m_log.ErrorFormat("[CLIENT]: BeginRecieve threw exception " + e.Message + ": " + e.StackTrace ); 309 // We don't need to see this error, reset connection and get next UDP packet off the buffer
310 // If the UDP packet is part of the same stream, this will happen several hundreds of times before
311 // the next set of UDP data is for a valid client.
312 //m_log.ErrorFormat("[CLIENT]: BeginRecieve threw exception " + e.Message + ": " + e.StackTrace );
313
314 // ENDLESS LOOP ON PURPOSE!
310 ResetEndPoint(); 315 ResetEndPoint();
311 } 316 }
312 } 317 }
@@ -322,10 +327,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
322 m_log.Error("[UDPSERVER]: " + a); 327 m_log.Error("[UDPSERVER]: " + a);
323 } 328 }
324 329
330 // ENDLESS LOOP ON PURPOSE!
331
332 // We need to purge the UDP stream of crap from the client that disconnected nastily or the UDP server will die
333 // The only way to do that is to beginreceive again!
334 BeginReceive();
335
325 try 336 try
326 { 337 {
327 m_socket.BeginReceiveFrom( 338 // m_socket.BeginReceiveFrom(
328 RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref reusedEpSender, ReceivedData, null); 339 // RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref reusedEpSender, ReceivedData, null);
329 340
330 // Ter: For some stupid reason ConnectionReset basically kills our async event structure.. 341 // Ter: For some stupid reason ConnectionReset basically kills our async event structure..
331 // so therefore.. we've got to tell the server to BeginReceiveFrom again. 342 // so therefore.. we've got to tell the server to BeginReceiveFrom again.