예제 #1
0
파일: Program.cs 프로젝트: Fehrox/Tachyon
        static void Main(string[] args)
        {
            var client = new RPCClient(new Client(), new JsonSerializer());

            client.OnConnected       += () => Console.WriteLine("Connected to server.");
            client.OnFailedToConnect += () => Console.WriteLine("FailedToConnect");
            client.OnDisconnected    += () => Console.WriteLine("Disconnected");
            client.Connect("localhost", 13);

            //client.OnRecieved += (bytes) => {
            //    var str = Encoding.ASCII.GetString(bytes);
            //    Console.WriteLine(str);
            //};

            client.On <LogDTO>(Log);
            client.On <LogDTO>(LogWarning);

            int i = 0;

            while (true)
            {
                Console.ReadKey();

                _sw.Restart();
                client.Ask <long>("Ping", Pong, DateTime.Now.Ticks);
                client.Send("Log", new LogDTO {
                    Message = "Console speaks! " + i++
                });
            }
        }
예제 #2
0
        public void ConnectToServer()
        {
            SelectedMenuItem(x => x.TargetTabType == typeof(TextBox));
            RPCClient.ReadyForSendingCommands += RPCClient_ReadyForSendingCommands;
            RPCClient.SocketError             += RPCClient_SocketError;

            Log(string.Format("Connecting to '{0}' on port {1}...", Context.ServerInfo.Address, Context.ServerInfo.XmlRpcPort));

            RPCClient.Connect();
        }
예제 #3
0
        public static void Main(string[] args)
        {
            IOdoo odoo = RPCClient.Connect(
                "www.redis-stock.com",
                8069,
                false,
                "bitnami_odoo",
                "*****@*****.**",
                "*****@*****.**"
                );

            System.Console.WriteLine("Odoo version: " + odoo.Version);
        }
예제 #4
0
    public void Start()
    {
        var clientCore = GetComponent <Client>();

        _client = new RPCClient(clientCore, new JsonSerializer());

        _client.OnConnected       += () => Debug.Log("Connected to server.");
        _client.OnFailedToConnect += () => Debug.Log("FailedToConnect");
        _client.OnDisconnected    += () => Debug.Log("Disconnected");
        _client.Connect("127.0.0.1", 13);

        _client.OnRecieved += OnRecieved;
        _client.On <LogDTO>(Log);
        _client.On <LogDTO>(LogWarning);
    }
예제 #5
0
 private void ReconnectButton_Click(object sender, RoutedEventArgs e)
 {
     RPCClient.Connect();
 }