コード例 #1
0
        public Push Push(string event_, JObject payload = null)
        {
            if (!_alreadyJoinedOnce)
            {
                throw new Exception(string.Format("tried to push {0} to {1} before joining. Use Channel.Join() before pushing events", event_, payload));
            }

            var pushEvent = new Push(this, event_, payload);

            if (CanPush())
            {
                pushEvent.Send();
            }
            else
            {
                _pushBuffer.Add(pushEvent);
            }

            return(pushEvent);
        }
コード例 #2
0
 private void SendJoin()
 {
     _state = ChannelState.Joining;
     _joinPush.Send();
 }
コード例 #3
0
ファイル: Channel.cs プロジェクト: nhocki/CSharpPhoenixClient
        public Push Push(string event_, JObject payload = null)
        {
            if (!_alreadyJoinedOnce)
            {
                throw new Exception(string.Format("tried to push {0} to {1} before joining. Use Channel.Join() before pushing events", event_, payload));
            }

            var pushEvent = new Push(this, event_, payload);

            if (CanPush())
            {
                pushEvent.Send();
            }
            else
            {
                _pushBuffer.Add(pushEvent);
            }

            return pushEvent;
        }