示例#1
0
        /// <summary>
        /// Creates a new management parser.
        /// </summary>
        /// <param name="oc">reference to the network communicator</param>
        /// <param name="ol">reference to the management logic</param>
        /// <param name="logs">reference to the log interface</param>
        internal OVPNManagementParser(OVPNCommunicator oc, OVPNManagementLogic ol, OVPNLogManager logs)
        {
            // copy data
            m_logs = logs;
            m_ol   = ol;

            // receive new data
            oc.gotLine += new OVPNCommunicator.GotLineEvent(oc_gotLine);
        }
示例#2
0
        /// <summary>
        /// Initializes a new OVPN Object.
        /// </summary>
        /// <param name="host">Host to connect to which holds the management interface</param>
        /// <param name="port">Port to connect to</param>
        /// <param name="earlyLogEvent">Delegate to a event processor</param>
        /// <param name="earlyLogLevel">Log level</param>
        /// <seealso cref="logs"/>
        public OVPNConnection(string host, int port, OVPNLogManager.LogEventDelegate earlyLogEvent, int earlyLogLevel)
        {
            m_host = host;
            m_port = port;

            m_logs            = new OVPNLogManager(this);
            m_logs.debugLevel = earlyLogLevel;
            if (earlyLogEvent != null)
            {
                m_logs.LogEvent += earlyLogEvent;
            }

            m_ovpnMLogic = new OVPNManagementLogic(this, host, port, m_logs);
            changeState(OVPNState.STOPPED);
        }