SocketIO.Client.Namespace.EmitLocally C# (CSharp) Method

EmitLocally() public method

public EmitLocally ( string eventName, object data = null, Action ack = null ) : void
eventName string
data object
ack Action
return void
      public void EmitLocally(string eventName, object[] data = null, Action<string> ack = null)
      {
         if (string.IsNullOrEmpty(eventName) || !m_eventListeners.ContainsKey(eventName)) 
            return;
         
         m_eventListenerLock.EnterReadLock();

         var callbacks = m_eventListeners[eventName];

         foreach (var cb in callbacks)
         {
            try { cb(data, ack); } catch { /* Intentionally suppress errors blank. */ }
         }

         m_eventListenerLock.ExitReadLock();
      }

Same methods

Namespace::EmitLocally ( string eventName ) : void