private IEnumerator UnsubscribeCoroutine(string channel) { SubscribeMessageData sub = new SubscribeMessageData(channel); string json = JsonConvert.SerializeObject(sub); webSocket.SendAsync(PostmanMassageData.BuildMessage(MessageType.UNSUBSCRIBE, json), null); yield return(null); }
private IEnumerator PublishCoroutine(string channel, string message, string tag, string extention) { PublishMessageData pub = new PublishMessageData(channel, message, tag, extention); string json = JsonConvert.SerializeObject(pub); if (Application.platform == RuntimePlatform.Android) { webSocket.Send(PostmanMassageData.BuildMessage(MessageType.PUBLISH, json)); } else { webSocket.SendAsync(PostmanMassageData.BuildMessage(MessageType.PUBLISH, json), null); } yield return(null); }
private IEnumerator PingCoroutine() { webSocket.SendAsync(PostmanMassageData.BuildMessage(MessageType.PING), null); yield return(null); }