* 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;
enablePackets.Add(enablesimpacket);
}
catch (Exception e)
catch
{
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
}
@ -294,7 +294,7 @@ namespace OpenSim.RegionServer.Simulator
startParcel = getParcel(start_x, start_y);
endParcel = getParcel(end_x, end_y);
}
catch (Exception e)
catch
{
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 *= this.m_regInfo.estateSettings.terrainMultiplier;
}
catch (Exception e)
catch
{
Console.WriteLine("Unable to load default terrain, procedurally generating instead...");
Terrain.hills();

View File

@ -135,7 +135,28 @@ namespace OpenSim.RegionServer
ipeSender = new IPEndPoint(IPAddress.Any, 0);
epSender = (EndPoint)ipeSender;
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;
packet = Packet.BuildPacket(RecvBuffer, ref packetEnd, ZeroBuffer);
@ -181,7 +202,7 @@ namespace OpenSim.RegionServer
ServerIncoming = new IPEndPoint(IPAddress.Any, listenPort);
Server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
Server.Bind(ServerIncoming);
m_console.Notice("UDPServer.cs:ServerListener() - UDP socket bound, getting ready to listen");
ipeSender = new IPEndPoint(IPAddress.Any, 0);