Exemplo n.º 1
0
        static void Main(string[] args)
        {
            ChatServer chatServer = new ChatServer();

            chatServer.OnMessageRecived    += ChatServer_OnMessageRecived;
            chatServer.OnErrMessageRecived += ChatServer_OnErrMessageRecived;
            chatServer.Start();
            IEnumerator enumerator = chatServer.GetSyncRoutine();

            for (int i = 0; i < 10000000; i++)
            {
                enumerator.MoveNext();

                if ((int)enumerator.Current == 0)
                {
                    break;
                }
            }
            Thread.Sleep(1000);
            chatServer.Stop();
            chatServer.Start();

            chatServer.RunSyncRoutine();
        }
Exemplo n.º 2
0
 public void StartServer()
 {
     ChatServer.Start();
     Coroutine = ChatServer.GetSyncRoutine();
     StartCoroutine(Coroutine);
 }