aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-09-07 00:47:08 +0000
committerJustin Clarke Casey2008-09-07 00:47:08 +0000
commitea8c18f63d7d8079bc790524bc99e9e067f29737 (patch)
treefbd44be8c88d2f0147f809d992fd4b96d49c9668
parentRemove a few of the commented out "NotImplemented" (diff)
downloadopensim-SC-ea8c18f63d7d8079bc790524bc99e9e067f29737.zip
opensim-SC-ea8c18f63d7d8079bc790524bc99e9e067f29737.tar.gz
opensim-SC-ea8c18f63d7d8079bc790524bc99e9e067f29737.tar.bz2
opensim-SC-ea8c18f63d7d8079bc790524bc99e9e067f29737.tar.xz
* minor: just minor doc and tidy up
-rw-r--r--OpenSim/Framework/Communications/LoginResponse.cs2
-rw-r--r--OpenSim/Framework/PacketPool.cs4
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs26
3 files changed, 28 insertions, 4 deletions
diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs
index 16be2b7..f92d66f 100644
--- a/OpenSim/Framework/Communications/LoginResponse.cs
+++ b/OpenSim/Framework/Communications/LoginResponse.cs
@@ -131,7 +131,7 @@ namespace OpenSim.Framework.Communications
131 SetDefaultValues(); 131 SetDefaultValues();
132 } 132 }
133 133
134 public void SetDefaultValues() 134 private void SetDefaultValues()
135 { 135 {
136 DST = "N"; 136 DST = "N";
137 StipendSinceLogin = "N"; 137 StipendSinceLogin = "N";
diff --git a/OpenSim/Framework/PacketPool.cs b/OpenSim/Framework/PacketPool.cs
index 27e74ca..07a2f3a 100644
--- a/OpenSim/Framework/PacketPool.cs
+++ b/OpenSim/Framework/PacketPool.cs
@@ -117,6 +117,10 @@ namespace OpenSim.Framework
117 return packet; 117 return packet;
118 } 118 }
119 119
120 /// <summary>
121 /// Return a packet to the packet pool
122 /// </summary>
123 /// <param name="packet"></param>
120 public void ReturnPacket(Packet packet) 124 public void ReturnPacket(Packet packet)
121 { 125 {
122 return; // packet pool disabled 126 return; // packet pool disabled
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
index 92321b6..ceb99ae 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs
@@ -40,6 +40,9 @@ using OpenSim.Region.Environment.Scenes;
40 40
41namespace OpenSim.Region.ClientStack.LindenUDP 41namespace OpenSim.Region.ClientStack.LindenUDP
42{ 42{
43 /// <summary>
44 /// This class handles the initial UDP circuit setup with a client and passes on subsequent packets to the LLPacketServer
45 /// </summary>
43 public class LLUDPServer : LLClientStackNetworkHandler, IClientNetworkServer 46 public class LLUDPServer : LLClientStackNetworkHandler, IClientNetworkServer
44 { 47 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -55,7 +58,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
55 protected byte[] RecvBuffer = new byte[4096]; 58 protected byte[] RecvBuffer = new byte[4096];
56 protected byte[] ZeroBuffer = new byte[8192]; 59 protected byte[] ZeroBuffer = new byte[8192];
57 protected IPEndPoint ipeSender; 60 protected IPEndPoint ipeSender;
61
62 /// <value>
63 /// The endpoint of a sender of a particular packet. The port is continually changed by the various socket receive methods
64 /// </value>
58 protected EndPoint epSender; 65 protected EndPoint epSender;
66
59 protected EndPoint epProxy; 67 protected EndPoint epProxy;
60 protected int proxyPortOffset; 68 protected int proxyPortOffset;
61 protected AsyncCallback ReceivedData; 69 protected AsyncCallback ReceivedData;
@@ -145,6 +153,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
145 new LLPacketServer(this); 153 new LLPacketServer(this);
146 } 154 }
147 155
156 /// <summary>
157 /// This method is called every time that we receive new UDP data. We pass this data on to the LLPacketServer
158 /// except in the case that the packet is UseCircuitCode. In this case we set up the circuit code instead.
159 /// </summary>
160 /// <param name="result"></param>
148 protected virtual void OnReceivedData(IAsyncResult result) 161 protected virtual void OnReceivedData(IAsyncResult result)
149 { 162 {
150 ipeSender = new IPEndPoint(listenIP, 0); 163 ipeSender = new IPEndPoint(listenIP, 0);
@@ -226,10 +239,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
226 { 239 {
227 ret = clientCircuits.TryGetValue(epSender, out circuit); 240 ret = clientCircuits.TryGetValue(epSender, out circuit);
228 } 241 }
242
229 if (ret) 243 if (ret)
230 { 244 {
231 //if so then send packet to the packetserver 245 //if so then send packet to the packetserver
232 //m_log.Warn("[UDPSERVER]: ALREADY HAVE Circuit!"); 246 //m_log.DebugFormat("[UDPSERVER]: For endpoint {0} got packet {1}", epSender, packet.Type);
247
233 m_packetServer.InPacket(circuit, packet); 248 m_packetServer.InPacket(circuit, packet);
234 } 249 }
235 else if (packet.Type == PacketType.UseCircuitCode) 250 else if (packet.Type == PacketType.UseCircuitCode)
@@ -311,6 +326,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
311 } 326 }
312 } 327 }
313 328
329 /// <summary>
330 /// Add a new client circuit.
331 /// </summary>
332 /// <param name="packet"></param>
314 protected virtual void AddNewClient(Packet packet) 333 protected virtual void AddNewClient(Packet packet)
315 { 334 {
316 //Slave regions don't accept new clients 335 //Slave regions don't accept new clients
@@ -325,7 +344,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
325 if (!clientCircuits.ContainsKey(epSender)) 344 if (!clientCircuits.ContainsKey(epSender))
326 clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); 345 clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
327 else 346 else
328 m_log.Error("[UDPSERVER]: clientCircuits already contans entry for user " + useCircuit.CircuitCode.Code.ToString() + ". NOT adding."); 347 m_log.Error("[UDPSERVER]: clientCircuits already contains entry for user " + useCircuit.CircuitCode.Code.ToString() + ". NOT adding.");
329 } 348 }
330 349
331 // This doesn't need locking as it's synchronized data 350 // This doesn't need locking as it's synchronized data
@@ -345,13 +364,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
345 364
346 PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_authenticateSessionsClass, epProxy); 365 PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_authenticateSessionsClass, epProxy);
347 } 366 }
367
348 PacketPool.Instance.ReturnPacket(packet); 368 PacketPool.Instance.ReturnPacket(packet);
349 } 369 }
350 370
351 public void ServerListener() 371 public void ServerListener()
352 { 372 {
353 uint newPort = listenPort; 373 uint newPort = listenPort;
354 m_log.Info("[SERVER]: Opening UDP socket on " + listenIP.ToString() + " " + newPort + "."); 374 m_log.Info("[SERVER]: Opening UDP socket on " + listenIP + " " + newPort + ".");
355 375
356 ServerIncoming = new IPEndPoint(listenIP, (int)newPort); 376 ServerIncoming = new IPEndPoint(listenIP, (int)newPort);
357 m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); 377 m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);