Exemple #1
0
        protected override void OnMessage(MessageEventArgs e)
        {
            // Retrieve message from client
            string msg = e.Data;

            Send("Echo: " + msg);
            WSController_standard.um(msg);
        }
Exemple #2
0
 /// <summary>
 /// create WebSocket by ip and port
 /// </summary>
 /// <param name="ip"></param>
 /// <param name="port"></param>
 /// <returns></returns>
 public bool CreateWSServer(int port, string state)
 {
     try
     {
         if (state == "super")
         {
             wsc = new WSController_super(port, WSOutput);
         }
         else
         {
             wsc2 = new WSController_standard(port, WSOutput);
         }
         mode = state;
         return(true);
     }
     catch (Exception e) {
         MainComm(e.ToString());
         return(false);
     }
 }
Exemple #3
0
 protected override void OnOpen()
 {
     WSController_standard.um("Arduino device has connected.");
     WSController_standard.SendToSession = Send;
 }
Exemple #4
0
 protected override void OnOpen()
 {
     WSController_standard.um("Android device has connected. ID: " + this.ID);
     WSController_standard.SendToSession = Send;
 }