private void OnMessageArrived(ITcpConnection connection, byte[] message) { try { _messageArrivedHandler(connection, message, reply => connection.QueueMessage(reply)); } catch (Exception ex) { _logger.Error("Handle message error.", ex); } }
private void OnMessageArrived(ITcpConnection connection, byte[] message) { try { _messageArrivedHandler(connection, message, reply => { Task.Factory.StartNew(() => connection.QueueMessage(reply)); }); } catch (Exception ex) { _logger.Error(string.Format("Socket server handle message has exception, name: {0}, listeningEndPoint: {1}", _name, _listeningEndPoint), ex); } }
private void OnMessageArrived(ITcpConnection connection, byte[] message) { try { _messageArrivedHandler(connection, message, reply => { Task.Factory.StartNew(() => connection.QueueMessage(reply)); }); } catch (Exception ex) { LogUtil.Error("Handle message error.", ex); } }