Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
 private IEnumerator PingCoroutine()
 {
     webSocket.SendAsync(PostmanMassageData.BuildMessage(MessageType.PING), null);
     yield return(null);
 }