示例#1
0
文件: Push.cs 项目: jfis/dn-phoenix
    public Push(Channel channel, string event_, JObject payload, int timeout)
    { //jfis - things seem too tied together. do pushes really need to know which channel they belong to? do channels need to know socket?
      _channel = channel;
      _event = event_;
      _payload = payload ?? Phoenix.EMPTY_JS_OBJECT;
      _receivedResp = null;
      _timeout = timeout;

      _timeoutTimer = new Timer()
      {
        AutoReset = false,
        Interval = _timeout
      };
      _timeoutTimer.Elapsed += (o, e) => Trigger("timeout", Phoenix.EMPTY_JS_OBJECT);

      _recHooks = new List<ReceiveHook>();
      //_sent = false;
    }
示例#2
0
文件: Socket.cs 项目: jfis/dn-phoenix
 //remove(channel){
 //  this.channels = this.channels.filter( c => !c.isMember(channel.topic) )
 //}
 internal void Remove(Channel channel)
 {
   _channels = _channels.Where(c => !c.IsMember(channel.Topic)).ToList();
 }
示例#3
0
文件: Socket.cs 项目: jfis/dn-phoenix
 //channel(topic, chanParams = {}){
 //  let chan = new Channel(topic, chanParams, this)
 //  this.channels.push(chan)
 //  return chan
 //}
 public Channel Channel(string topic, JObject chanParams)
 {
   var chan = new Channel(topic, chanParams, this);
   _channels.Add(chan);
   //jfis - js ppl have strange way of naming things. socket.Channel to makes and adds a channel. not obvious.
   return chan;
 }
示例#4
0
 internal void Remove(Channel channel)
 {
     // PhoenixJS: see the note above regarding stateChangeCallbacks
     // this.off(channel.stateChangeRefs)
     _channels.Remove(channel);
 }