/// <summary> /// Creates a new <see cref="BroConnection"/> with specified connection parameters. /// </summary> /// <param name="hostName">Host name, formatted as host:port, to connect to.</param> /// <param name="flags">Connection flags for this <see cref="BroConnection"/>.</param> /// <exception cref="ArgumentNullException"><paramref name="hostName"/> is <c>null</c>.</exception> /// <exception cref="OutOfMemoryException">Failed to create Bro connection.</exception> public BroConnection(string hostName, BroConnectionFlags flags = BroConnectionFlags.None) : this() { if ((object)hostName == null) { throw new ArgumentNullException("hostName"); } m_connectionPtr = BroApi.bro_conn_new_str(hostName, flags); if (m_connectionPtr.IsInvalid()) { throw new OutOfMemoryException("Failed to create Bro connection."); } m_hostName = hostName; m_flags = flags; }