Exemple #1
0
    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;
    }
Exemple #2
0
 //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();
 }
Exemple #3
0
 //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;
 }
Exemple #4
0
 internal void Remove(Channel channel)
 {
     // PhoenixJS: see the note above regarding stateChangeCallbacks
     // this.off(channel.stateChangeRefs)
     _channels.Remove(channel);
 }