public void BeginSendTo(TcpSocketSession session, byte[] data, int offset, int count) { GuardRunning(); if (session == null) { throw new ArgumentNullException("session"); } if (data == null) { throw new ArgumentNullException("data"); } TcpSocketSession writeSession = null; if (_sessions.TryGetValue(session.SessionKey, out writeSession)) { session.BeginSend(data, offset, count); } else { _log.WarnFormat("Cannot find session [{0}].", session); } }
public IAsyncResult BeginSendTo(TcpSocketSession session, byte[] data, int offset, int count, AsyncCallback callback, object state) { GuardRunning(); if (session == null) { throw new ArgumentNullException("session"); } if (data == null) { throw new ArgumentNullException("data"); } TcpSocketSession writeSession = null; if (_sessions.TryGetValue(session.SessionKey, out writeSession)) { return(session.BeginSend(data, offset, count, callback, state)); } else { _log.WarnFormat("Cannot find session [{0}].", session); } return(null); }
public void BeginSendTo(string sessionKey, byte[] data, int offset, int count) { GuardRunning(); if (string.IsNullOrEmpty(sessionKey)) { throw new ArgumentNullException("sessionKey"); } if (data == null) { throw new ArgumentNullException("data"); } TcpSocketSession session = null; if (_sessions.TryGetValue(sessionKey, out session)) { session.BeginSend(data, offset, count); } else { Logs.Warn(string.Format("Cannot find session [{0}].", sessionKey)); } }