Ejemplo n.º 1
0
    public void reset()
    {
        SetStep s = new SetStep();

        s.func = "reset";
        Send(JsonUtility.ToJson(s));
    }
Ejemplo n.º 2
0
    private void ReceiveData()
    {
        try {
            while (true)
            {
                while (client.Available > 0)
                {
                    Debug.Log(1111111111111);
                    int    bytesRec = client.Receive(bytes);
                    String message  = Encoding.ASCII.GetString(bytes, 0, bytesRec);
                    Debug.Log(message);

                    SetStep s = JsonUtility.FromJson <SetStep>(message);
                    this.step = s.step;
                }
            }
        } catch (SocketException exception) {
            Debug.Log("Socket exception: " + exception);
        }
    }