public LLPacketServer(ILLClientStackNetworkHandler networkHandler, ClientStackUserSettings userSettings) { m_userSettings = userSettings; m_networkHandler = networkHandler; m_networkHandler.RegisterPacketServer(this); }
/// <summary> /// Initialize the server /// </summary> /// <param name="_listenIP"></param> /// <param name="port"></param> /// <param name="proxyPortOffsetParm"></param> /// <param name="allow_alternate_port"></param> /// <param name="configSource"></param> /// <param name="assetCache"></param> /// <param name="circuitManager"></param> public void Initialise( IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, IAssetCache assetCache, AgentCircuitManager circuitManager) { ClientStackUserSettings userSettings = new ClientStackUserSettings(); IConfig config = configSource.Configs["ClientStack.LindenUDP"]; if (config != null) { if (config.Contains("client_throttle_multiplier")) { userSettings.ClientThrottleMultipler = config.GetFloat("client_throttle_multiplier"); } } m_log.DebugFormat("[CLIENT]: client_throttle_multiplier = {0}", userSettings.ClientThrottleMultipler); proxyPortOffset = proxyPortOffsetParm; listenPort = (uint)(port + proxyPortOffsetParm); listenIP = _listenIP; Allow_Alternate_Port = allow_alternate_port; m_assetCache = assetCache; m_circuitManager = circuitManager; CreatePacketServer(userSettings); // Return new port // This because in Grid mode it is not really important what port the region listens to as long as it is correctly registered. // So the option allow_alternate_ports="true" was added to default.xml port = (uint)(listenPort - proxyPortOffsetParm); }
public LLPacketQueue(UUID agentId, ClientStackUserSettings userSettings) { // While working on this, the BlockingQueue had me fooled for a bit. // The Blocking queue causes the thread to stop until there's something // in it to process. it's an on-purpose threadlock though because // without it, the clientloop will suck up all sim resources. SendQueue = new OpenSim.Framework.BlockingQueue <LLQueItem>(); IncomingPacketQueue = new Queue <LLQueItem>(); OutgoingPacketQueue = new Queue <LLQueItem>(); ResendOutgoingPacketQueue = new Queue <LLQueItem>(); LandOutgoingPacketQueue = new Queue <LLQueItem>(); WindOutgoingPacketQueue = new Queue <LLQueItem>(); CloudOutgoingPacketQueue = new Queue <LLQueItem>(); TaskOutgoingPacketQueue = new Queue <LLQueItem>(); TaskLowpriorityPacketQueue = new Queue <LLQueItem>(); TextureOutgoingPacketQueue = new Queue <LLQueItem>(); AssetOutgoingPacketQueue = new Queue <LLQueItem>(); // Store the throttle multiplier for posterity. throttleMultiplier = userSettings.ClientThrottleMultipler; // Set up the throttle classes (min, max, current) in bits per second ResendThrottle = new LLPacketThrottle(5000, 100000, 16000, userSettings.ClientThrottleMultipler); LandThrottle = new LLPacketThrottle(1000, 100000, 2000, userSettings.ClientThrottleMultipler); WindThrottle = new LLPacketThrottle(0, 100000, 0, userSettings.ClientThrottleMultipler); CloudThrottle = new LLPacketThrottle(0, 100000, 0, userSettings.ClientThrottleMultipler); TaskThrottle = new LLPacketThrottle(1000, 800000, 3000, userSettings.ClientThrottleMultipler); AssetThrottle = new LLPacketThrottle(1000, 800000, 1000, userSettings.ClientThrottleMultipler); TextureThrottle = new LLPacketThrottle(1000, 800000, 4000, userSettings.ClientThrottleMultipler); // Total Throttle trumps all - it is the number of bits in total that are allowed to go out per second. ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings; if (null == totalThrottleSettings) { totalThrottleSettings = new ThrottleSettings(0, 1500000, 28000); } TotalThrottle = new LLPacketThrottle( totalThrottleSettings.Min, totalThrottleSettings.Max, totalThrottleSettings.Current, userSettings.ClientThrottleMultipler); throttleTimer = new Timer((int)(throttletimems / throttleTimeDivisor)); throttleTimer.Elapsed += ThrottleTimerElapsed; throttleTimer.Start(); // TIMERS needed for this // LastThrottle = DateTime.Now.Ticks; // ThrottleInterval = (long)(throttletimems/throttleTimeDivisor); m_agentId = agentId; if (StatsManager.SimExtraStats != null) { StatsManager.SimExtraStats.RegisterPacketQueueStatsProvider(m_agentId, this); } }
//////////////////////////////////////////////////////////////////// // Constructors // public LLPacketHandler(IClientAPI client, LLPacketServer server, ClientStackUserSettings userSettings) { m_Client = client; m_PacketServer = server; m_DropSafeTimeout = Environment.TickCount + 15000; m_PacketQueue = new LLPacketQueue(client.AgentId, userSettings); m_AckTimer.Elapsed += AckTimerElapsed; m_AckTimer.Start(); }
/// <summary> /// Add a client for testing /// </summary> /// <param name="scene"></param> /// <param name="testLLUDPServer"></param> /// <param name="testPacketServer"></param> /// <param name="acm">Agent circuit manager used in setting up the stack</param> protected void SetupStack( IScene scene, out TestLLUDPServer testLLUDPServer, out TestLLPacketServer testPacketServer, out AgentCircuitManager acm) { IConfigSource configSource = new IniConfigSource(); ClientStackUserSettings userSettings = new ClientStackUserSettings(); testLLUDPServer = new TestLLUDPServer(); acm = new AgentCircuitManager(); uint port = 666; testLLUDPServer.Initialise(null, ref port, 0, false, configSource, acm); testPacketServer = new TestLLPacketServer(testLLUDPServer, userSettings); testLLUDPServer.LocalScene = scene; }
public LLPacketQueue(UUID agentId, ClientStackUserSettings userSettings) { // While working on this, the BlockingQueue had me fooled for a bit. // The Blocking queue causes the thread to stop until there's something // in it to process. it's an on-purpose threadlock though because // without it, the clientloop will suck up all sim resources. SendQueue = new OpenSim.Framework.BlockingQueue<LLQueItem>(); IncomingPacketQueue = new Queue<LLQueItem>(); OutgoingPacketQueue = new Queue<LLQueItem>(); ResendOutgoingPacketQueue = new Queue<LLQueItem>(); LandOutgoingPacketQueue = new Queue<LLQueItem>(); WindOutgoingPacketQueue = new Queue<LLQueItem>(); CloudOutgoingPacketQueue = new Queue<LLQueItem>(); TaskOutgoingPacketQueue = new Queue<LLQueItem>(); TaskLowpriorityPacketQueue = new Queue<LLQueItem>(); TextureOutgoingPacketQueue = new Queue<LLQueItem>(); AssetOutgoingPacketQueue = new Queue<LLQueItem>(); // Store the throttle multiplier for posterity. throttleMultiplier = userSettings.ClientThrottleMultipler; // Set up the throttle classes (min, max, current) in bits per second ResendThrottle = new LLPacketThrottle(5000, 100000, 16000, userSettings.ClientThrottleMultipler); LandThrottle = new LLPacketThrottle(1000, 100000, 2000, userSettings.ClientThrottleMultipler); WindThrottle = new LLPacketThrottle(0, 100000, 0, userSettings.ClientThrottleMultipler); CloudThrottle = new LLPacketThrottle(0, 100000, 0, userSettings.ClientThrottleMultipler); TaskThrottle = new LLPacketThrottle(1000, 800000, 3000, userSettings.ClientThrottleMultipler); AssetThrottle = new LLPacketThrottle(1000, 800000, 1000, userSettings.ClientThrottleMultipler); TextureThrottle = new LLPacketThrottle(1000, 800000, 4000, userSettings.ClientThrottleMultipler); // Total Throttle trumps all - it is the number of bits in total that are allowed to go out per second. ThrottleSettings totalThrottleSettings = userSettings.TotalThrottleSettings; if (null == totalThrottleSettings) { totalThrottleSettings = new ThrottleSettings(0, 1500000, 28000); } TotalThrottle = new LLPacketThrottle( totalThrottleSettings.Min, totalThrottleSettings.Max, totalThrottleSettings.Current, userSettings.ClientThrottleMultipler); throttleTimer = new Timer((int) (throttletimems/throttleTimeDivisor)); throttleTimer.Elapsed += ThrottleTimerElapsed; throttleTimer.Start(); // TIMERS needed for this // LastThrottle = DateTime.Now.Ticks; // ThrottleInterval = (long)(throttletimems/throttleTimeDivisor); m_agentId = agentId; if (StatsManager.SimExtraStats != null) { StatsManager.SimExtraStats.RegisterPacketQueueStatsProvider(m_agentId, this); } }
protected virtual void CreatePacketServer(ClientStackUserSettings userSettings) { new LLPacketServer(this, userSettings); }
public TestLLPacketServer(LLUDPServer networkHandler, ClientStackUserSettings userSettings) : base(networkHandler, userSettings) { }
public TestLLPacketServer(LLUDPServer networkHandler, ClientStackUserSettings userSettings) : base(networkHandler, userSettings) {}
/// <summary> /// Initialize the server /// </summary> /// <param name="_listenIP"></param> /// <param name="port"></param> /// <param name="proxyPortOffsetParm"></param> /// <param name="allow_alternate_port"></param> /// <param name="configSource"></param> /// <param name="assetCache"></param> /// <param name="circuitManager"></param> public void Initialise( IPAddress _listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) { ClientStackUserSettings userSettings = new ClientStackUserSettings(); IConfig config = configSource.Configs["ClientStack.LindenUDP"]; if (config != null) { if (config.Contains("client_throttle_max_bps")) { int maxBPS = config.GetInt("client_throttle_max_bps", 1500000); userSettings.TotalThrottleSettings = new ThrottleSettings(0, maxBPS, maxBPS > 28000 ? maxBPS : 28000); } if (config.Contains("client_throttle_multiplier")) userSettings.ClientThrottleMultipler = config.GetFloat("client_throttle_multiplier"); if (config.Contains("client_socket_rcvbuf_size")) m_clientSocketReceiveBuffer = config.GetInt("client_socket_rcvbuf_size"); } m_log.DebugFormat("[CLIENT]: client_throttle_multiplier = {0}", userSettings.ClientThrottleMultipler); m_log.DebugFormat("[CLIENT]: client_socket_rcvbuf_size = {0}", (m_clientSocketReceiveBuffer != 0 ? m_clientSocketReceiveBuffer.ToString() : "OS default")); proxyPortOffset = proxyPortOffsetParm; listenPort = (uint) (port + proxyPortOffsetParm); listenIP = _listenIP; Allow_Alternate_Port = allow_alternate_port; m_circuitManager = circuitManager; CreatePacketServer(userSettings); // Return new port // This because in Grid mode it is not really important what port the region listens to as long as it is correctly registered. // So the option allow_alternate_ports="true" was added to default.xml port = (uint)(listenPort - proxyPortOffsetParm); }