public void StartTest(byte[] fileBytes) { this._fileBytes = fileBytes; this._client = new RTMClient( "52.83.245.22:13325", 11000001, this._uid, this._token, // "rtm-intl-frontgate.funplus.com:13325", // 11000002, // 777779, // "BE3732174850E479209443BCCDF4747D", // "52.83.245.22:13325", // 1000012, // 654321, // "63B3F146B2A1DA8660B167D26A610C0D", // "rtm-intl-frontgate.funplus.com:13325", // 11000001, // 777779, // "12861748F2D641907D181D1CDB6DF174", RTMConfig.TRANS_LANGUAGE.en, new Dictionary <string, string>(), true, 20 * 1000, true ); RTMProcessor processor = this._client.GetProcessor(); processor.AddPushService(RTMConfig.SERVER_PUSH.recvMessage, (data) => { Debug.Log("[recvMessage]: " + Json.SerializeToString(data)); Debug.Log("[recvMessage]: " + data["msg"]); }); TestCase self = this; this._client.GetEvent().AddListener("login", (evd) => { Exception ex = evd.GetException(); if (ex != null) { Debug.Log("TestCase connect err: " + ex.Message); } else { Debug.Log("TestCase connect! gate: " + evd.GetPayload()); self.StartThread(); } }); this._client.GetEvent().AddListener("close", (evd) => { Debug.Log("TestCase closed!"); }); this._client.GetEvent().AddListener("error", (evd) => { Debug.Log("TestCase error: " + evd.GetException()); }); this._client.Login(null); }
public void StartTest(byte[] fileBytes) { receiveClient = new RTMClient( "52.83.245.22:13325", 11000001, 777779, TOKEN_777779, RTMConfig.TRANS_LANGUAGE.en, new Dictionary <string, string>(), true, 20 * 1000, true ); SingleMicphone self = this; receiveClient.GetEvent().AddListener("login", (evd) => { if (evd.GetException() == null) { Debug.Log("777779 login!"); } else { Debug.Log(evd.GetException()); } }); receiveClient.GetEvent().AddListener("error", (evd) => { Debug.Log(evd.GetException()); }); RTMProcessor processor = receiveClient.GetProcessor(); processor.AddPushService(RTMConfig.SERVER_PUSH.recvAudio, (data) => { Debug.Log("777779 receive audio!"); lock (self_locker) { self._audioBytes = (byte[])data["msg"]; } }); receiveClient.Login(null); this._micphone = new BaseMicrophone(); RTMMicrophone.Instance.InitMic(null, this._micphone); Debug.Log("microphone start input!"); RTMMicrophone.Instance.StartInput(); }
public void StartTest(byte[] fileBytes) { this._client = new RTMClient( "52.83.245.22:13325", 11000001, 777779, "FA77FB4FA1E19E3EA7A9500DC6D9649C", RTMConfig.TRANS_LANGUAGE.en, new Dictionary <string, string>(), true, 20 * 1000, // false true ); SingleClientSend self = this; this._client.GetEvent().AddListener("login", (evd) => { if (evd.GetException() == null) { Debug.Log("test start!"); self.StartThread(); } else { Debug.Log(evd.GetException()); } }); this._client.GetEvent().AddListener("close", (evd) => { Debug.Log("closed!"); self.StopThread(); }); this._client.GetEvent().AddListener("error", (evd) => { Debug.Log(evd.GetException()); }); RTMProcessor processor = this._client.GetProcessor(); processor.AddPushService(RTMConfig.SERVER_PUSH.recvMessage, (data) => { Debug.Log("[recvMessage]: " + Json.SerializeToString(data)); }); this._client.Login(null); }
public void StartTest(byte[] fileBytes) { this._client = new RTMClient( "rtm-intl-frontgate.funplus.com:13325", 11000002, 777779, "266B02147F447DD931C48B747F5ED9E7", RTMConfig.TRANS_LANGUAGE.en, new Dictionary <string, string>(), true, 20 * 1000, // false true ); SingleClientPush self = this; this._client.GetEvent().AddListener("login", (evd) => { if (evd.GetException() == null) { Debug.Log("test start!"); } else { Debug.Log(evd.GetException()); } }); this._client.GetEvent().AddListener("close", (evd) => { Debug.Log("closed!"); }); this._client.GetEvent().AddListener("error", (evd) => { Debug.Log(evd.GetException()); }); RTMProcessor processor = this._client.GetProcessor(); processor.AddPushService(RTMConfig.SERVER_PUSH.recvPing, (data) => { self.RevcInc(); // Debug.Log("[PUSH] ping: " + Json.SerializeToString(data)); }); processor.AddPushService(RTMConfig.SERVER_PUSH.recvMessage, (data) => { self.RevcInc(); // Debug.Log("[recvMessage]: " + Json.SerializeToString(data)); }); processor.AddPushService(RTMConfig.SERVER_PUSH.recvGroupMessage, (data) => { self.RevcInc(); // Debug.Log("[recvGroupMessage]: "); }); processor.AddPushService(RTMConfig.SERVER_PUSH.recvRoomMessage, (data) => { self.RevcInc(); // Debug.Log("[recvRoomMessage]: "); }); processor.AddPushService(RTMConfig.SERVER_PUSH.recvBroadcastMessage, (data) => { self.RevcInc(); // Debug.Log("[recvBroadcastMessage]: "); }); processor.AddPushService(RTMConfig.SERVER_PUSH.recvFile, (data) => { self.RevcInc(); // Debug.Log("[recvFile]: "); }); processor.AddPushService(RTMConfig.SERVER_PUSH.recvRoomFile, (data) => { self.RevcInc(); // Debug.Log("[recvRoomFile]: "); }); processor.AddPushService(RTMConfig.SERVER_PUSH.recvGroupFile, (data) => { self.RevcInc(); // Debug.Log("[recvGroupFile]: "); }); processor.AddPushService(RTMConfig.SERVER_PUSH.recvBroadcastFile, (data) => { self.RevcInc(); // Debug.Log("[recvBroadcastFile]: "); }); this._client.Login(null); }