/// <summary> /// Create a new publisher /// </summary> /// <remarks>The publisher is a very central class; generally there should be only one per process. /// More specifically, there should be a one to one relationship between publisher, packet cache, and /// messengers to ensure integrity of the message output.</remarks> public Publisher(string sessionName, AgentConfiguration configuration, SessionSummary sessionSummary) { if (string.IsNullOrEmpty(sessionName)) { throw new ArgumentNullException(nameof(sessionName)); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } if (sessionSummary == null) { throw new ArgumentNullException(nameof(sessionSummary)); } //store off all our input m_SessionName = sessionName; m_SessionSummary = sessionSummary; m_Configuration = configuration; //create our queue, cache, and messenger objects m_MessageQueue = new Queue <PacketEnvelope>(50); //a more or less arbitrary initial queue size. m_MessageOverflowQueue = new Queue <PacketEnvelope>(50); //a more or less arbitrary initial queue size. m_CachedTypes = new PacketDefinitionList(); m_PacketCache = new PacketCache(); m_Messengers = new List <IMessenger>(); m_MessageQueueMaxLength = Math.Max(configuration.Publisher.MaxQueueLength, 1); //make sure there's no way to get it below 1. //create the thread we use for dispatching messages CreateMessageDispatchThread(); }
/// <summary> /// Create a new publisher /// </summary> /// <remarks>The publisher is a very central class; generally there should be only one per process. /// More specifically, there should be a one to one relationship between publisher, packet cache, and /// messengers to ensure integrity of the message output.</remarks> internal Publisher(string sessionName, AgentConfiguration configuration, SessionSummary sessionSummary, IPrincipalResolver principalResolver, IApplicationUserProvider userProvider) { if (string.IsNullOrEmpty(sessionName)) { throw new ArgumentNullException(nameof(sessionName)); } if (configuration == null) { throw new ArgumentNullException(nameof(configuration)); } if (sessionSummary == null) { throw new ArgumentNullException(nameof(sessionSummary)); } //store off all our input m_SessionName = sessionName; m_SessionSummary = sessionSummary; m_Configuration = configuration; var serverConfig = Log.Configuration.Server; if (serverConfig.AutoSendOnError && serverConfig.AutoSendSessions && serverConfig.Enabled) { m_AutoSendOnError = true; } //create our queue, cache, and messenger objects m_MessageQueue = new Queue <PacketEnvelope>(50); //a more or less arbitrary initial queue size. m_MessageOverflowQueue = new Queue <PacketEnvelope>(50); //a more or less arbitrary initial queue size. m_CachedTypes = new PacketDefinitionList(); m_PacketCache = new PacketCache(); m_Messengers = new List <IMessenger>(); m_Filters = new List <ILoupeFilter>(); m_MessageQueueMaxLength = Math.Max(configuration.Publisher.MaxQueueLength, 1); //make sure there's no way to get it below 1. m_PrincipalResolver = principalResolver; m_ApplicationUserProvider = userProvider; //create the thread we use for dispatching messages CreateMessageDispatchThread(); }
public PacketVersion() { Packets = new PacketDefinitionList(); }