コード例 #1
0
        public void SendToAsync(string sessionKey, byte[] data)
        {
            if (!IsListening)
            {
                throw new InvalidOperationException("The server has stopped to listen.");
            }

            TcpSocketSession session = null;

            if (_sessions.TryGetValue(sessionKey, out session))
            {
                _server.BeginSendTo(session, data);
            }
            else
            {
                _log.WarnFormat("SendToAsync, cannot find target client [{0}].", sessionKey);
            }
        }