Пример #1
0
 public void SendDataAsync(byte[] _payloadByteArray, Session _session)
 {
     if (_payloadByteArray == null)
         throw new NullReferenceException();
     _session.SendDataAsync();
 }
Пример #2
0
 public void ReadDataAsync(Session _session)
 {
     if (_session == null)
         throw new NullReferenceException();
     _session.ReadDataAsync();
 }
Пример #3
0
 public void RemoveSession(Session _session)
 {
     if (_session == null) throw new ArgumentNullException();
     lock (sessionDictionary)
     {
         _session.SessionDataRecieved -= HandleSessionDataRecieved;
         _session.Dispose();
         SessionRemovedTrigger();
     }
 }
Пример #4
0
        public void AddSession(Session _session)
        {
            if (_session == null)
                throw new ArgumentNullException();

            lock (sessionDictionary)
            {
                _session.SessionDataRecieved += HandleSessionDataRecieved; // Subscribe to the session event handlers
                //session.SessionDataSent
                //TODO: Add the session to the dictionary, using the local guid recieved from the remote endpoint.
                SessionCreatedTrigger();
            }
        }