Esempio n. 1
0
 public void Connect()
 {
     winSys.Connect();
     umdSrv.Connect();
     IsConnectedWinSys = ConnectState.Connected;
     IsConnectedAPI    = ConnectState.Connected;
     OnPropertyChanged();
 }
        private void btnConnect_Click(object sender, RoutedEventArgs e)
        {
            var server = txtBoxServer.Text;
            var port   = txtBoxPort.Text;

            ClientSocketConnection.Connect(server, port);
            ClientSocketConnection.NewMessageReady += GetData;
            commandAllowed    = true;
            txtBoxStatus.Text = ClientSocketConnection.Status.ToString();
        }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        client = new ClientSocketConnection();
        client.Connect("192.168.1.51", "8027");

        EventManager.StartListening("RightButton", new UnityAction(RightButton));
        EventManager.StartListening("LeftButton", new UnityAction(LeftButton));
        EventManager.StartListening("ForwardButton", new UnityAction(ForwardButton));
        EventManager.StartListening("ReverseButton", new UnityAction(ReverseButton));
        EventManager.StartListening("StopButton", new UnityAction(StopButton));
    }
Esempio n. 4
0
        protected void InitConnections()
        {
            SocketSettings srvSet = new SocketSettings();

            // srvSet.
            //Connect to UMD Server
            //umdSrv = new ClientSocketConnection(umdurl, umdport, name + "_ToUMD", ref sm, rm);
            umdSrv = new ClientSocketConnection(srvSet, ref sm, rm);
            umdSrv.Connect();

            //Connect to WinSys Server
            winSys = new ClientSocketConnection(srvSet, ref sm, rm);
            winSys.Connect();
        }
Esempio n. 5
0
 //public virtual void InitConnections(string umdurl = "localhost", ushort umdport = 81, string winurl="localhost", ushort winport=8181)
 public virtual void InitConnections(SocketSettings srvSet)
 {
     if (winSys == null)
     {
         this.winurl  = srvSet.clienturl;  //winurl;
         this.winport = srvSet.clientport; // winport;
         rm           = new ReceiveMsgDelegate(ReceiveMessageCB);
         //Connect to WinSys Server
         winSys = new ClientSocketConnection(srvSet, ref smWinsys, rm);
         winSys.Connect();
     }
     if (umdSrv == null)
     {
         this.umdurl  = srvSet.url;
         this.umdport = srvSet.port;
         //Connect to UMD Server
         umdSrv = new ClientSocketConnection(srvSet, ref smUMDSrv, rm);
         umdSrv.Connect();
     }
     else
     {
         umdSrv.ReInit(ref smUMDSrv);
     }
 }