diff --git a/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs b/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs index 9b1751d76d..e78a4fe36f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/OpenSimUDPBase.cs @@ -198,9 +198,6 @@ namespace OpenMetaverse // to AsyncBeginReceive if (!m_shutdownFlag) { - // start another receive - this keeps the server going! - AsyncBeginReceive(); - // get the buffer that was created in AsyncBeginReceive // this is the received data //WrappedObject wrappedBuffer = (WrappedObject)iar.AsyncState; @@ -219,7 +216,14 @@ namespace OpenMetaverse } catch (SocketException) { } catch (ObjectDisposedException) { } - //finally { wrappedBuffer.Dispose(); } + finally + { + // wrappedBuffer.Dispose(); + + // start another receive - this keeps the server going! + AsyncBeginReceive(); + } + } }