Ejemplo n.º 1
0
        public static void Send(byte[] data)
        {
            var msg = new Message();

            msg.data = data;
            msg.size = (byte)data.Length;
            ClientRUDPS.Send(msg);
        }
Ejemplo n.º 2
0
        public static void Receive(string host, UInt16 port)
        {
            ClientRUDPS.Start(host, port);

            ClientRUDPS.ReceiveAsObservable.Subscribe(buffer =>
            {
                // Debug.Log(buffer.Length);
                var type = (Protocol)buffer[0];
                Action <byte[]> action;
                if (OnNexts.TryGetValue(type, out action))
                {
                    action(buffer);
                }
            });
        }