예제 #1
0
        public static void Publsh(string channelName, object data)
        {
            PrivateMethods.Validate();
            var jsonObj = new Dictionary <string, object>
            {
                { "channel", CloudApp.AppID + channelName },
                { "data", data }
            };

            _socket.Emit("publish-custom-channel", jsonObj);
        }
예제 #2
0
 public static void On(string channelName, Callback callback)
 {
     PrivateMethods.Validate();
     _socket.Emit("join-custom-channel", CloudApp.AppID + channelName);
     _socket.On(CloudApp.AppID + channelName, data => { callback(data); });
 }
예제 #3
0
 public static void Off(string channelName)
 {
     PrivateMethods.Validate();
     _socket.Emit("leave-custom-channel", CloudApp.AppID + channelName);
     _socket.Off(CloudApp.AppID + channelName);
 }