/// <summary> /// Create Actual Connection and initiate wait for response within this thread /// </summary> private void p_CreateConnection(BonCodeAJP13PacketCollection packetsToSend) { p_AbortConnection = false; p_ConnectionsID++; //increment the number of connections p_ConnectionsCounter++; p_ThisConnectionID = p_ConnectionsCounter; //assign the connection id if (p_ConnectionsID > BonCodeAJP13Settings.MAX_BONCODEAJP13_CONCURRENT_CONNECTIONS) { //throw exception if we exceeded concurrent connections //Exception e = new Exception("0:Maximum connection limit exceeded. Please change limit setting if change is desired. Dropping connection."); //throw e; } try { //create new connection and timer if we maintain connection timeout within this class if (p_TCPClient == null) { p_TCPClient = new TcpClient(p_Server, p_Port); p_KeepAliveTimer = new System.Timers.Timer(); p_KeepAliveTimer.Interval = BonCodeAJP13Consts.BONCODEAJP13_SERVER_KEEP_ALIVE_TIMEOUT; p_KeepAliveTimer.Elapsed += new System.Timers.ElapsedEventHandler(p_KeepAliveTimer_Elapsed); p_KeepAliveTimer.AutoReset = false; p_KeepAliveTimer.Enabled = true; //starts the timer } //start p_StopWatch p_StopWatch.Start(); //assign package and wait for response p_PacketsToSend = packetsToSend; //handle connection HandleConnection(); } catch (Exception e) { if (p_Logger != null) { p_Logger.LogException(e, "TCP Client level -- Server/Port:" + p_Server + "/" + p_Port.ToString()); } ConnectionError(); return; } }
public void LogExceptionTest() { string fileName = string.Empty; // TODO: Initialize to an appropriate value Mutex loggerMutex = null; // TODO: Initialize to an appropriate value BonCodeAJP13Logger target = new BonCodeAJP13Logger(fileName, loggerMutex); // TODO: Initialize to an appropriate value Exception e = null; // TODO: Initialize to an appropriate value string message = string.Empty; // TODO: Initialize to an appropriate value int onlyAboveLogLevel = 0; // TODO: Initialize to an appropriate value target.LogException(e, message, onlyAboveLogLevel); Assert.Inconclusive("A method that does not return a value cannot be verified."); }