• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# LLClientView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LLClientView的典型用法代码示例。如果您正苦于以下问题:C# LLClientView类的具体用法?C# LLClientView怎么用?C# LLClientView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LLClientView类属于命名空间,在下文中一共展示了LLClientView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SendPackets

        /// <summary>
        ///   Sends packets for this texture to a client until packetsToSend is 
        ///   hit or the transfer completes
        /// </summary>
        /// <param name = "client">Reference to the client that the packets are destined for</param>
        /// <param name = "packetsToSend">Maximum number of packets to send during this call</param>
        /// <param name = "packetsSent">Number of packets sent during this call</param>
        /// <returns>True if the transfer completes at the current discard level, otherwise false</returns>
        public bool SendPackets(LLClientView client, int packetsToSend, out int packetsSent)
        {
            packetsSent = 0;

            if (m_currentPacket <= m_stopPacket)
            {
                bool sendMore = true;

                if (!m_sentInfo || (m_currentPacket == 0))
                {
                    sendMore = !SendFirstPacket(client);

                    m_sentInfo = true;
                    ++m_currentPacket;
                    ++packetsSent;
                }
                if (m_currentPacket < 2)
                {
                    m_currentPacket = 2;
                }

                while (sendMore && packetsSent < packetsToSend && m_currentPacket <= m_stopPacket)
                {
                    sendMore = SendPacket(client);
                    ++m_currentPacket;
                    ++packetsSent;
                }
            }

            return (m_currentPacket > m_stopPacket);
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:39,代码来源:J2KImage.cs


示例2: LLImageManager

 //Constructor
 public LLImageManager(LLClientView client, IAssetService pAssetCache, IJ2KDecoder pJ2kDecodeModule)
 {
     
     m_imagestore = new Dictionary<UUID,J2KImage>();
     m_priorities = new SortedList<double,UUID>();
     m_priorityresolver = new Dictionary<int, int>();
     m_client = client;
     m_assetCache = pAssetCache;
     if (pAssetCache != null)
         m_missingsubstitute = pAssetCache.Get("5748decc-f629-461c-9a36-a35a221fe21f");
     else
         m_log.Error("[ClientView] - couldn't set missing image, all manner of things will probably break");
     m_j2kDecodeModule = pJ2kDecodeModule;
 }
开发者ID:ChrisD,项目名称:opensim,代码行数:15,代码来源:LLImageManager.cs


示例3: SendPacket

        private bool SendPacket(LLClientView client)
        {
            if (client == null || m_asset == null)
                return false;

            bool complete = false;
            int imagePacketSize = ((int) m_currentPacket == (TexturePacketCount()))
                                      ? LastPacketSize()
                                      : IMAGE_PACKET_SIZE;

            try
            {
                if ((CurrentBytePosition() + IMAGE_PACKET_SIZE) > m_asset.Length)
                {
                    imagePacketSize = LastPacketSize();
                    complete = true;
                    if ((CurrentBytePosition() + imagePacketSize) > m_asset.Length)
                    {
                        imagePacketSize = m_asset.Length - CurrentBytePosition();
                        complete = true;
                    }
                }

                // It's concievable that the client might request packet one
                // from a one packet image, which is really packet 0,
                // which would leave us with a negative imagePacketSize..
                if (imagePacketSize > 0)
                {
                    byte[] imageData = new byte[imagePacketSize];
                    int currentPosition = CurrentBytePosition();

                    try
                    {
                        Buffer.BlockCopy(m_asset, currentPosition, imageData, 0, imagePacketSize);
                    }
                    catch (Exception e)
                    {
                        MainConsole.Instance.ErrorFormat(
                            "[J2KIMAGE]: Texture block copy for the first packet failed. textureid={0}, assetlength={1}, currentposition={2}, imagepacketsize={3}, exception={4}",
                            TextureID, m_asset.Length, currentPosition, imagePacketSize, e.Message);
                        return false;
                    }

                    //Send the packet
                    client.SendImageNextPart((ushort) (m_currentPacket - 1), TextureID, imageData);
                }

                return !complete;
            }
            catch (Exception)
            {
                return false;
            }
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:54,代码来源:J2KImage.cs


示例4: SendFirstPacket

        private bool SendFirstPacket(LLClientView client)
        {
            if (client == null)
                return false;

            if (m_asset == null)
            {
                MainConsole.Instance.Warn("[J2KIMAGE]: Sending ImageNotInDatabase for texture " + TextureID);
                client.SendImageNotFound(TextureID);
                return true;
            }
            if (m_asset.Length <= FIRST_PACKET_SIZE)
            {
                // We have less then one packet's worth of data
                client.SendImageFirstPart(1, TextureID, (uint) m_asset.Length, m_asset, 2);
                m_stopPacket = 0;
                return true;
            }
            // This is going to be a multi-packet texture download
            byte[] firstImageData = new byte[FIRST_PACKET_SIZE];

            try
            {
                Buffer.BlockCopy(m_asset, 0, firstImageData, 0, FIRST_PACKET_SIZE);
            }
            catch (Exception)
            {
                MainConsole.Instance.ErrorFormat(
                    "[J2KIMAGE]: Texture block copy for the first packet failed. textureid={0}, assetlength={1}",
                    TextureID, m_asset.Length);
                return true;
            }

            client.SendImageFirstPart(TexturePacketCount(), TextureID, (uint) m_asset.Length, firstImageData,
                                      (byte) ImageCodec.J2C);
            return false;
        }
开发者ID:nathanmarck,项目名称:Aurora-Sim,代码行数:37,代码来源:J2KImage.cs


示例5: AddClient

        public virtual bool AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint,
            AgentCircuitData sessionInfo)
        {
            MainConsole.Instance.Debug("[LLUDPServer] AddClient-" + circuitCode + "-" + agentID + "-" + sessionID + "-" +
                                       remoteEndPoint +
                                       "-" + sessionInfo);
            IScenePresence SP;
            if (!m_scene.TryGetScenePresence(agentID, out SP))
            {
                // Create the LLUDPClient
                LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID,
                                                        remoteEndPoint, m_defaultRTO, m_maxRTO);
                // Create the LLClientView
                LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID,
                                                       sessionID, circuitCode);
                client.OnLogout += LogoutHandler;

                // Start the IClientAPI
                m_scene.AddNewClient(client, null);
                m_currentClients.Add(client);
            }
            else
            {
                MainConsole.Instance.DebugFormat(
                    "[LLUDPSERVER]: Ignoring a repeated UseCircuitCode ({0}) from {1} at {2} ",
                    circuitCode, agentID, remoteEndPoint);
            }
            return true;
        }
开发者ID:BogusCurry,项目名称:WhiteCore-Dev,代码行数:29,代码来源:LLUDPServer.cs


示例6: AddClient

        /// <summary>
        /// Add a client.
        /// </summary>
        /// <param name="circuitCode"></param>
        /// <param name="agentID"></param>
        /// <param name="sessionID"></param>
        /// <param name="remoteEndPoint"></param>
        /// <param name="sessionInfo"></param>
        /// <returns>The client if it was added.  Null if the client already existed.</returns>
        protected virtual IClientAPI AddClient(
            uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
        {
            IClientAPI client = null;

            // In priciple there shouldn't be more than one thread here, ever.
            // But in case that happens, we need to synchronize this piece of code
            // because it's too important
            lock (this) 
            {
                if (!m_scene.TryGetClient(agentID, out client))
                {
                    LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);

                    client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
                    client.OnLogout += LogoutHandler;

                    ((LLClientView)client).DisableFacelights = m_disableFacelights;

                    client.Start();
                }
            }

            return client;
        }
开发者ID:OpenPlex-Sim,项目名称:opensim,代码行数:34,代码来源:LLUDPServer.cs


示例7: SendPacket

        private bool SendPacket(LLClientView client)
        {
            bool complete = false;
            int imagePacketSize = ((int)m_packetNumber == (TexturePacketCount())) ? LastPacketSize() : cImagePacketSize;

            try
            {
                if ((CurrentBytePosition() + cImagePacketSize) > m_asset.Data.Length)
                {
                    imagePacketSize = LastPacketSize();
                    complete=true;
                    if ((CurrentBytePosition() + imagePacketSize) > m_asset.Data.Length)
                    {
                        imagePacketSize = m_asset.Data.Length - CurrentBytePosition();
                        complete = true;
                    }
                }

                // It's concievable that the client might request packet one
                // from a one packet image, which is really packet 0,
                // which would leave us with a negative imagePacketSize..
                if (imagePacketSize > 0)
                {
                    byte[] imageData = new byte[imagePacketSize];
                    try
                    {
                        Buffer.BlockCopy(m_asset.Data, CurrentBytePosition(), imageData, 0, imagePacketSize);
                    }
                    catch (Exception e)
                    {
                        m_log.Error("Error copying texture block. Out of memory? imagePacketSize was " + imagePacketSize.ToString() + " on packet " + m_packetNumber.ToString() + " out of " + m_stopPacket.ToString() + ". Exception: " + e.ToString());
                        return false;
                    }

                    //Send the packet
                    client.SendImageNextPart((ushort)(m_packetNumber-1), m_requestedUUID, imageData);
                }
                if (complete)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
            catch (Exception)
            {
                return false;
            }
        }
开发者ID:ChrisD,项目名称:opensim,代码行数:51,代码来源:J2KImage.cs


示例8: AddClient

        /// <summary>
        /// Add a client.
        /// </summary>
        /// <param name="circuitCode"></param>
        /// <param name="agentID"></param>
        /// <param name="sessionID"></param>
        /// <param name="remoteEndPoint"></param>
        /// <param name="sessionInfo"></param>
        /// <returns>The client if it was added.  Null if the client already existed.</returns>
        protected virtual IClientAPI AddClient(
            uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
        {
            IClientAPI client = null;

            // We currently synchronize this code across the whole scene to avoid issues such as
            // http://opensimulator.org/mantis/view.php?id=5365  However, once locking per agent circuit can be done
            // consistently, this lock could probably be removed.
            lock (this)
            {
                if (!m_scene.TryGetClient(agentID, out client))
                {
                    LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
    
                    client = new LLClientView(m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
                    client.OnLogout += LogoutHandler;
                    client.DebugPacketLevel = DefaultClientPacketDebugLevel;
    
                    ((LLClientView)client).DisableFacelights = m_disableFacelights;
    
                    client.Start();
                }
            }

            return client;
        }
开发者ID:JeffCost,项目名称:opensim,代码行数:35,代码来源:LLUDPServer.cs


示例9: AddClient

        protected virtual bool AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AgentCircuitData sessionInfo)
        {
            IScenePresence SP; 
            if (!m_scene.TryGetScenePresence(agentID, out SP))
            {
                // Create the LLUDPClient
                LLUDPClient udpClient =  new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
                // Create the LLClientView
                LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
                client.OnLogout += LogoutHandler;

                client.DisableFacelights = m_disableFacelights;

                // Start the IClientAPI
                m_scene.AddNewClient(client);
                m_currentClients.Add (client);
            }
            else
            {
                m_log.DebugFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode ({0}) from {1} at {2} ",
                    circuitCode, agentID, remoteEndPoint);
            }
            return true;
        }
开发者ID:HGExchange,项目名称:Aurora-Sim,代码行数:24,代码来源:LLUDPServer.cs


示例10: DeactivateClientDueToTimeout

     /// <summary>
     /// Deactivates the client if we don't receive any packets within a certain amount of time (default 60 seconds).
     /// </summary>
     /// <remarks>
     /// If a connection is active then we will always receive packets even if nothing else is happening, due to
     /// regular client pings.
     /// </remarks>
     /// <param name='client'></param>
     private void DeactivateClientDueToTimeout(LLClientView client)
     {
         lock (client.CloseSyncLock)
         {
             m_log.WarnFormat(
                 "[LLUDPSERVER]: Ack timeout, disconnecting {0} agent for {1} in {2}",
                 client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, m_scene.RegionInfo.RegionName);
 
             StatsManager.SimExtraStats.AddAbnormalClientThreadTermination();
 
             if (!client.SceneAgent.IsChildAgent)
                  client.Kick("Simulator logged you out due to connection timeout");
 
             client.CloseWithoutChecks();
         }
     }
开发者ID:TheCoffeeTime,项目名称:Opensim,代码行数:24,代码来源:LLUDPServer.cs


示例11: AddClient

        protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
        {
            // In priciple there shouldn't be more than one thread here, ever.
            // But in case that happens, we need to synchronize this piece of code
            // because it's too important
            lock (this) 
            {
                IClientAPI existingClient;

                if (!m_scene.TryGetClient(agentID, out existingClient))
                {
                    // Create the LLUDPClient
                    LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
                    // Create the LLClientView
                    LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
                    client.OnLogout += LogoutHandler;

                    client.DisableFacelights = m_disableFacelights;

                    // Start the IClientAPI
                    client.Start();

                }
                else
                {
                    m_log.WarnFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode from {0} at {1} for circuit {2}",
                        existingClient.AgentId, remoteEndPoint, circuitCode);
                }
            }
        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:30,代码来源:LLUDPServer.cs


示例12: IncomingPacket

 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="client">Reference to the client this packet came from</param>
 /// <param name="packet">Packet data</param>
 public IncomingPacket(LLClientView client, Packet packet)
 {
     Client = client;
     Packet = packet;
 }
开发者ID:CassieEllen,项目名称:opensim,代码行数:10,代码来源:IncomingPacket.cs


示例13: AddNewClient

        private bool AddNewClient(UseCircuitCodePacket useCircuitCode, IPEndPoint remoteEndPoint)
        {
            UUID agentID = useCircuitCode.CircuitCode.ID;
            UUID sessionID = useCircuitCode.CircuitCode.SessionID;
            uint circuitCode = useCircuitCode.CircuitCode.Code;

            try
            {
                m_log.InfoFormat(
                        "[LLUDPSERVER]: UCC Received for client {0} circuit code {1}",
                        useCircuitCode.CircuitCode.ID, useCircuitCode.CircuitCode.Code);

                LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
                LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, agentID, sessionID, circuitCode);

                m_scene.ConnectionManager.TryAttachUdpCircuit(client);
                client.Start();

                return true;
            }
            catch (OpenSim.Region.Framework.Connection.AttachUdpCircuitException e)
            {
                if (e.CircuitAlreadyExisted)
                {
                    m_log.WarnFormat("[LLUDPSERVER]: Ignoring duplicate UDP connection request. {0}", e.Message);

                    //if the circuit matches, we can ACK the UCC since the client should be
                    //able to communicate with the current circuit
                    if (e.ExistingCircuitMatched)
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
                else
                {
                    m_log.ErrorFormat("[LLUDPSERVER]: Unable to start new connection: {0}", e);
                    return false;
                }
            }
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:44,代码来源:LLUDPServer.cs


示例14: AddClient

        protected virtual bool AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
        {
            // Create the LLUDPClient
            LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
            IClientAPI existingClient;
            //Check to make sure we arn't handling two or more circuit codes from the client if we are lagging badly.
            // The block below this (TryGetClient) works as well, but if it gets locked up before the client is added to the scene, it will break
            //  So we do this check here as well.
            lock (m_handlingCircuitCodes)
            {
                if (m_handlingCircuitCodes.Contains(agentID))
                    return false;
                m_handlingCircuitCodes.Add(agentID);
            }

            if (!m_scene.TryGetClient(agentID, out existingClient))
            {
                // Create the LLClientView
                LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
                client.OnLogout += LogoutHandler;

                client.DisableFacelights = m_disableFacelights;

                // Start the IClientAPI
                client.Start();
                //Remove it from the check
                m_handlingCircuitCodes.Remove(agentID);
                return true;
            }
            else
            {
                m_log.WarnFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode from {0} at {1} for circuit {2}",
                    udpClient.AgentID, remoteEndPoint, circuitCode);
            }
            //Remove it from the check
            m_handlingCircuitCodes.Remove(agentID);
            return false;
        }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:38,代码来源:LLUDPServer.cs


示例15: SendPackets

        public bool SendPackets(LLClientView client, int maxpack)
        {

            if (!m_completedSendAtCurrentDiscardLevel)
            {
                if (m_packetNumber <= m_stopPacket)
                {
                    bool SendMore = true;
                    if (!m_sentinfo || (m_packetNumber == 0))
                    {
                        if (SendFirstPacket(client))
                        {
                            SendMore = false;
                        }
                        m_sentinfo = true;
                        m_packetNumber++;
                    }
                    // bool ignoreStop = false;
                    if (m_packetNumber < 2)
                    {
                        m_packetNumber = 2;
                    }

                    int count = 0;
                    while (SendMore && count < maxpack && m_packetNumber <= m_stopPacket)
                    {
                        count++;
                        SendMore = SendPacket(client);
                        m_packetNumber++;
                    }

                    if (m_packetNumber > m_stopPacket)
                    {
                        return true;
                    }
                }
            }
            return false;
        }
开发者ID:ChrisD,项目名称:opensim,代码行数:39,代码来源:J2KImage.cs


示例16: AddClient

        protected virtual void AddClient(uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo)
        {
            // Create the LLUDPClient
            LLUDPClient udpClient = new LLUDPClient(this, m_throttleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
            IClientAPI existingClient;

            if (!m_scene.TryGetClient(agentID, out existingClient))
            {
                // Create the LLClientView
                LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
                client.OnLogout += LogoutHandler;

                client.DisableFacelights = m_disableFacelights;

                // Start the IClientAPI
                client.Start();
            }
            else
            {
                m_log.WarnFormat("[LLUDPSERVER]: Ignoring a repeated UseCircuitCode from {0} at {1} for circuit {2}",
                    udpClient.AgentID, remoteEndPoint, circuitCode);
            }
        }
开发者ID:WordfromtheWise,项目名称:Aurora,代码行数:23,代码来源:LLUDPServer.cs


示例17: DeactivateClientDueToTimeout

        /// <summary>
        /// Deactivates the client if we don't receive any packets within a certain amount of time (default 60 seconds).
        /// </summary>
        /// <remarks>
        /// If a connection is active then we will always receive packets even if nothing else is happening, due to
        /// regular client pings.
        /// </remarks>
        /// <param name='client'></param>
        /// <param name='timeoutTicks'></param>
        private void DeactivateClientDueToTimeout(LLClientView client, int timeoutTicks)
        {
            lock (client.CloseSyncLock)
            {    
                ClientLogoutsDueToNoReceives++;

                m_log.WarnFormat(
					"[LLUDPSERVER]: Ack timeout, disconnecting {0} agent for {1} in {2} for {3}ms",
					client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, m_scene.Name, timeoutTicks);
    
                if (!client.SceneAgent.IsChildAgent)
                     client.Kick("Simulator logged you out due to connection timeout.");
            }

            m_scene.CloseAgent(client.AgentId, true);
        }
开发者ID:AkiraSonoda,项目名称:akisim,代码行数:25,代码来源:LLUDPServer.cs


示例18: HandleUnacked

        public void HandleUnacked(LLClientView client)
        {
            LLUDPClient udpClient = client.UDPClient;

            if (!udpClient.IsConnected)
                return;

            // Disconnect an agent if no packets are received for some time
            int timeoutTicks = m_ackTimeout;

            // Allow more slack if the client is "paused" eg file upload dialogue is open
            // Some sort of limit is needed in case the client crashes, loses its network connection
            // or some other disaster prevents it from sendung the AgentResume
            if (udpClient.IsPaused)
                timeoutTicks = m_pausedAckTimeout;

            if (client.IsActive &&
                (Environment.TickCount & Int32.MaxValue) - udpClient.TickLastPacketReceived > timeoutTicks)
            {
                // We must set IsActive synchronously so that we can stop the packet loop reinvoking this method, even
                // though it's set later on by LLClientView.Close()
                client.IsActive = false;

                // Fire this out on a different thread so that we don't hold up outgoing packet processing for
                // everybody else if this is being called due to an ack timeout.
                // This is the same as processing as the async process of a logout request.
                Util.FireAndForget(o => DeactivateClientDueToTimeout(client, timeoutTicks));

                return;
            }

            // Get a list of all of the packets that have been sitting unacked longer than udpClient.RTO
            List<OutgoingPacket> expiredPackets = udpClient.NeedAcks.GetExpiredPackets(udpClient.RTO);

            if (expiredPackets != null)
            {
                //m_log.Debug("[LLUDPSERVER]: Handling " + expiredPackets.Count + " packets to " + udpClient.AgentID + ", RTO=" + udpClient.RTO);
                // Exponential backoff of the retransmission timeout
                udpClient.BackoffRTO();
                for (int i = 0; i < expiredPackets.Count; ++i)
                    expiredPackets[i].UnackedMethod(expiredPackets[i]);
            }
        }
开发者ID:JeffCost,项目名称:opensim,代码行数:43,代码来源:LLUDPServer.cs


示例19: DeactivateClientDueToTimeout

        /// <summary>
        /// Deactivates the client if we don't receive any packets within a certain amount of time (default 60 seconds).
        /// </summary>
        /// <remarks>
        /// If a connection is active then we will always receive packets even if nothing else is happening, due to
        /// regular client pings.
        /// </remarks>
        /// <param name='client'></param>
        /// <param name='timeoutTicks'></param>
        private void DeactivateClientDueToTimeout(LLClientView client, int timeoutTicks)
        {
            lock (client.CloseSyncLock)
            {    
                ClientLogoutsDueToNoReceives++;

                m_log.WarnFormat(
                    "[LLUDPSERVER]: No packets received from {0} agent of {1} for {2}ms in {3}.  Disconnecting.",
                    client.SceneAgent.IsChildAgent ? "child" : "root", client.Name, timeoutTicks, m_scene.Name);
    
                if (!client.SceneAgent.IsChildAgent)
                     client.Kick("Simulator logged you out due to connection timeout.");
            }

            m_scene.IncomingCloseAgent(client.AgentId, true);
        }
开发者ID:JeffCost,项目名称:opensim,代码行数:25,代码来源:LLUDPServer.cs


示例20: SendFirstPacket

 public bool SendFirstPacket(LLClientView client)
 {
     // this means we don't have 
     if (Data == null) 
     {
         client.SendImageNotFound(m_requestedUUID);
         m_log.WarnFormat("[TEXTURE]: Got null Data element on a asset {0}..  and the missing image Data property is al", m_requestedUUID);
         return true;
     }
     // Do we have less then 1 packet's worth of data?
     else if (m_asset.Data.Length <= cFirstPacketSize)
     {
         // Send only 1 packet
         client.SendImageFirstPart(1, m_requestedUUID, (uint)m_asset.Data.Length, m_asset.Data, 2);
         m_stopPacket = 0;
         return true;
     }
     else
     {
         byte[] firstImageData = new byte[cFirstPacketSize];
         try 
         { 
             Buffer.BlockCopy(m_asset.Data, 0, firstImageData, 0, (int)cFirstPacketSize);
             client.SendImageFirstPart(TexturePacketCount(), m_requestedUUID, (uint)m_asset.Data.Length, firstImageData, 2);                
         }
         catch (Exception)
         {
             m_log.Error("Texture block copy failed. Possibly out of memory?");
             return true;
         }
     }
     return false;
 }
开发者ID:ChrisD,项目名称:opensim,代码行数:33,代码来源:J2KImage.cs



注:本文中的LLClientView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LLDB类代码示例发布时间:2022-05-24
下一篇:
C# LLAgent类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap