public void Connect()
        {
            EchoSocket.ConnectAsync();

            if (!IsRunning)
            {
                IsRunning = true;
                RoutineRunner.StartCoroutine(LogRoutine());
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var httpServer = new HelloWorldServer();
            var webSocketServer = new EchoSocket();
            var listener = new HttpWebSocketListener(httpServer, webSocketServer);

            Task.Factory.StartNew(() => listener.Run());

            Console.ReadKey();
        }
 public void SendMessage(string message)
 {
     EchoSocket.SendAsync(message, success =>
     {
         if (success)
         {
             LogQueue.Enqueue("1Sent: " + message);
         }
         else
         {
             LogQueue.Enqueue("1Failed to Send: " + message);
         }
     });
 }
 public void Disconnect()
 {
     EchoSocket.CloseAsync(CloseStatusCode.Normal);
 }
Esempio n. 5
0
 protected override IFastSocket CreateSocket(Socket client)
 {
     socket = new EchoSocket(this, client);
     return(socket);
 }