public static void Send(byte[] data) { var msg = new Message(); msg.data = data; msg.size = (byte)data.Length; ClientRUDPS.Send(msg); }
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); } }); }