public Emitter handleEmitAck(string Event, object Object, Ackcall ack) { if (singleackcallbacks.ContainsKey(Event)) { AckListener listener = singleackcallbacks[Event]; listener(Event, Object, ack); } return(this); }
public Emitter HandleEmitAck(string Event, object Object, Ackcall ack) { if (!_singleackcallbacks.ContainsKey(Event)) { return(this); } var listener = _singleackcallbacks[Event]; listener(Event, Object, ack); return(this); }
public bool Emit(string Event, object Object, Ackcall ack) { Log($"Emit with ack invoked, Event {Event}, Object {Object}, ACK {ack.GetMethodInfo().Name}."); var count = Interlocked.Increment(ref _counter); var eventObject = new Dictionary <string, object> { { "event", Event }, { "data", Object }, { "cid", count } }; _acks.Add(count, GetAckObject(Event, ack)); var json = _options.Serializer.Serialize(eventObject); return(_socket.Send(json)); }
public Socket unsubscribe(string Channel, Ackcall ack) { long count = Interlocked.Increment(ref counter); Dictionary <string, object> subscribeObject = new Dictionary <string, object> { { "event", "#unsubscribe" }, { "data", Channel }, { "cid", count } }; acks.Add(count, getAckObject(Channel, ack)); var json = JsonConvert.SerializeObject(subscribeObject, Formatting.Indented); _socket.Send(json); return(this); }
public Socket emit(string Event, object Object, Ackcall ack) { long count = Interlocked.Increment(ref counter); Dictionary <string, object> eventObject = new Dictionary <string, object> { { "event", Event }, { "data", Object }, { "cid", count } }; acks.Add(count, getAckObject(Event, ack)); var json = JsonConvert.SerializeObject(eventObject, Formatting.Indented); _socket.Send(json); return(this); }
public Socket Unsubscribe(string channel, Ackcall ack) { long count = Interlocked.Increment(ref _counter); Dictionary <string, object> subscribeObject = new Dictionary <string, object> { { "event", "#unsubscribe" }, { "data", channel }, { "cid", count } }; acks.Add(count, GetAckObject(channel, ack)); var json = JsonMapper.ToJson(subscribeObject); _socket.Send(json); return(this); }
public Socket Emit(string Event, object Object, Ackcall ack) { long count = Interlocked.Increment(ref _counter); Dictionary <string, object> eventObject = new Dictionary <string, object> { { "event", Event }, { "data", Object }, { "cid", count } }; acks.Add(count, GetAckObject(Event, ack)); var json = JsonMapper.ToJson(eventObject); _socket.Send(json); return(this); }
public bool Unsubscribe(string channel, Ackcall ack) { Log($"Unsubscribe with ACK invoked, Channel {channel}, ACK {ack.GetMethodInfo().Name}."); var count = Interlocked.Increment(ref _counter); var subscribeObject = new Dictionary <string, object> { { "event", "#unsubscribe" }, { "data", channel }, { "cid", count } }; _acks.Add(count, GetAckObject(channel, ack)); var json = _options.Serializer.Serialize(subscribeObject); return(_socket.Send(json)); }
public bool Publish(string channel, object data, Ackcall ack) { Log($"Publish with ACK invoked, Channel {channel}, Data {data}, ACK {ack.GetMethodInfo().Name}."); var count = Interlocked.Increment(ref _counter); var publishObject = new Dictionary <string, object> { { "event", "#publish" }, { "data", new Dictionary <string, object> { { "channel", channel }, { "data", data } } }, { "cid", count } }; _acks.Add(count, GetAckObject(channel, ack)); var json = _options.Serializer.Serialize(publishObject); return(_socket.Send(json)); }
public Socket Publish(string channel, object data, Ackcall ack) { long count = Interlocked.Increment(ref _counter); Dictionary <string, object> publishObject = new Dictionary <string, object> { { "event", "#publish" }, { "data", new Dictionary <string, object> { { "channel", channel }, { "data", data } } }, { "cid", count } }; acks.Add(count, GetAckObject(channel, ack)); var json = JsonMapper.ToJson(publishObject); _socket.Send(json); return(this); }
public void Unsubscribe(Ackcall ack) { _socket.Unsubscribe(_channelname, ack); _socket._channels.Remove(this); }
public void unsubscribe(Ackcall ack) { socket.unsubscribe(Channelname, ack); socket.channels.Remove(this); }
public void publish(object data, Ackcall ack) { socket.publish(Channelname, data, ack); }
public Channel subscribe(Ackcall ack) { socket.subscribe(Channelname, ack); return(this); }
private object[] getAckObject(string Event, Ackcall ack) { object [] Object = { Event, ack }; return(Object); }
public void Publish(object data, Ackcall ack) { _socket.Publish(_channelname, data, ack); }
public Channel Subscribe(Ackcall ack) { _socket.Subscribe(_channelname, ack); return(this); }
private static object[] GetAckObject(string Event, Ackcall ack) => new object[] { Event, ack };