當前位置: 首頁>>代碼示例>>C#>>正文


C# NetState.Start方法代碼示例

本文整理匯總了C#中Server.Network.NetState.Start方法的典型用法代碼示例。如果您正苦於以下問題:C# NetState.Start方法的具體用法?C# NetState.Start怎麽用?C# NetState.Start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Network.NetState的用法示例。


在下文中一共展示了NetState.Start方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CheckListener

		private void CheckListener()
		{
			for (int j = 0; j < m_Listeners.Length; ++j)
			{
				var accepted = m_Listeners[j].Slice();

				for (int i = 0; i < accepted.Length; ++i)
				{
					NetState ns = new NetState(accepted[i], this);
					ns.Start();

					if (ns.Running)
					{
						Utility.PushColor(ConsoleColor.Green);
						Console.WriteLine("Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count);
						Utility.PopColor();
					}
				}
			}
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:20,代碼來源:MessagePump.cs

示例2: CheckListener

        private void CheckListener()
        {
            for ( int j = 0; j < m_Listeners.Length; ++j )
            {
                Socket[] accepted = m_Listeners[j].Slice();

                for ( int i = 0; i < accepted.Length; ++i )
                {
                    NetState ns = new NetState( accepted[i], this );
                    ns.Start();

                    if ( ns.Running )
                        Console.WriteLine( "Client: {0}: Connected. [{1} Online]", ns, NetState.Instances.Count );
                }
            }
        }
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:16,代碼來源:MessagePump.cs

示例3: GameServerClient

        public static NetState GameServerClient(Config.GameServer config)
        {
            if (config == null)
                return null;

            String address = config.Address.ToString();
            NetState ns = (NetState)m_GameServers[address];
            if (ns != null)
                return ns;

            try {
                ns = new NetState(config.Address, Core.MessagePump);
                ns.Start();
                ns.Send(new SendSeed());
                m_GameServers[address] = ns;
                return ns;
            } catch (Exception e) {
                log.Error(String.Format("Exception while trying to connect to game server {0} ({1}): {2}",
                                        config.Name, address),
                          e);
                return null;
            }
        }
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:23,代碼來源:NetState.cs

示例4: CheckListener

        private void CheckListener()
        {
            foreach ( var socket in m_Listeners.SelectMany( listener => listener.Slice() ) )
            {
                NetState ns = new NetState( socket, this );
                ns.Start();

                if ( ns.Running )
                    InvokeConnected( ns );
            }
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:11,代碼來源:NetServer.cs


注:本文中的Server.Network.NetState.Start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。