* ignored data recieved from closed sockets

* removed some warnings
zircon^2
lbsa71 2007-06-12 18:47:36 +00:00
parent 75bdc185a9
commit 4d1d5eb0c6
4 changed files with 27 additions and 6 deletions

View File

@ -98,7 +98,7 @@ namespace OpenSim.RegionServer.Client
enablesimpacket.SimulatorInfo.Port = neighbourPort; enablesimpacket.SimulatorInfo.Port = neighbourPort;
enablePackets.Add(enablesimpacket); enablePackets.Add(enablesimpacket);
} }
catch (Exception e) catch
{ {
MainConsole.Instance.Notice("Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing."); MainConsole.Instance.Notice("Could not connect to neighbour " + neighbour["sim_ip"] + ":" + neighbour["sim_port"] + ", continuing.");
} }

View File

@ -237,7 +237,7 @@ namespace OpenSim.RegionServer.Simulator
} }
} }
} }
catch (Exception e) catch
{ {
return false; //Exception. For now, lets skip subdivision return false; //Exception. For now, lets skip subdivision
} }
@ -294,7 +294,7 @@ namespace OpenSim.RegionServer.Simulator
startParcel = getParcel(start_x, start_y); startParcel = getParcel(start_x, start_y);
endParcel = getParcel(end_x, end_y); endParcel = getParcel(end_x, end_y);
} }
catch (Exception e) catch
{ {
return false; //Error occured when trying to get the start and end parcels return false; //Error occured when trying to get the start and end parcels
} }

View File

@ -478,7 +478,7 @@ namespace OpenSim.RegionServer.Simulator
this.Terrain.loadFromFileF32(this.m_regInfo.estateSettings.terrainFile); this.Terrain.loadFromFileF32(this.m_regInfo.estateSettings.terrainFile);
this.Terrain *= this.m_regInfo.estateSettings.terrainMultiplier; this.Terrain *= this.m_regInfo.estateSettings.terrainMultiplier;
} }
catch (Exception e) catch
{ {
Console.WriteLine("Unable to load default terrain, procedurally generating instead..."); Console.WriteLine("Unable to load default terrain, procedurally generating instead...");
Terrain.hills(); Terrain.hills();

View File

@ -135,7 +135,28 @@ namespace OpenSim.RegionServer
ipeSender = new IPEndPoint(IPAddress.Any, 0); ipeSender = new IPEndPoint(IPAddress.Any, 0);
epSender = (EndPoint)ipeSender; epSender = (EndPoint)ipeSender;
Packet packet = null; Packet packet = null;
int numBytes = Server.EndReceiveFrom(result, ref epSender);
int numBytes;
try
{
numBytes = Server.EndReceiveFrom(result, ref epSender);
}
catch (SocketException e)
{
switch( e.SocketErrorCode )
{
case SocketError.NotConnected:
case SocketError.ConnectionReset:
// At this point, we should clear the client connection altogether.
// The app should hook a disconnect event into the UDPServer.
// But for now, just ignore it.
return;
default:
throw;
}
}
int packetEnd = numBytes - 1; int packetEnd = numBytes - 1;
packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer); packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);