// Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//     
//     private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//     
//     public static String getStringFromStackTrace(Exception exception) {
//         try {
//             StringWriter stringWriter = new StringWriter();
//             PrintWriter printWriter = new PrintWriter(stringWriter);
//             
//             exception.printStackTrace(printWriter);
//             
//             return stringWriter.toString();
//         }
//         catch (Exception e) {
//             logger.error(e.toString() + " - Failed to convert stack-trace to string");
//             return null;
//         }
//     }
//     
//     public static String getStringFromStackTrace(StackTraceElement[] stackTraceElements) {
//         try {
//             
//             StringBuilder stackTrace = new StringBuilder();
//             
//             for (StackTraceElement stackTraceElement : stackTraceElements) {
//                 stackTrace.append(stackTraceElement).append(System.lineSeparator());
//             }
//             
//             return stackTrace.toString();
//         }
//         catch (Exception e) {
//             logger.error(e.toString() + " - Failed to convert stack-trace to string");
//             return null;
//         }
//     }
//     
// }


import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.io.BufferedWriter;
import java.io.DataOutputStream;
import java.io.OutputStreamWriter;
import java.net.InetSocketAddress;
import java.net.Socket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
        
        return isSendSuccess;
    }
    
    public boolean isConnected() {
        
        if (socket_ == null) {
            return false;
        }
        
        try {
            return (socket_.isConnected() && !socket_.isClosed());
        }
        catch (Exception e) {
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
            return false;
        }
        
    }
    
    public boolean isClosed() {
        
        if (socket_ == null) {
            return true;
        }
        
        try {
            return (socket_.isClosed());
        }
        catch (Exception e) {
// Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//     
//     private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//     
//     public static String getStringFromStackTrace(Exception exception) {
//         try {
//             StringWriter stringWriter = new StringWriter();
//             PrintWriter printWriter = new PrintWriter(stringWriter);
//             
//             exception.printStackTrace(printWriter);
//             
//             return stringWriter.toString();
//         }
//         catch (Exception e) {
//             logger.error(e.toString() + " - Failed to convert stack-trace to string");
//             return null;
//         }
//     }
//     
//     public static String getStringFromStackTrace(StackTraceElement[] stackTraceElements) {
//         try {
//             
//             StringBuilder stackTrace = new StringBuilder();
//             
//             for (StackTraceElement stackTraceElement : stackTraceElements) {
//                 stackTrace.append(stackTraceElement).append(System.lineSeparator());
//             }
//             
//             return stackTrace.toString();
//         }
//         catch (Exception e) {
//             logger.error(e.toString() + " - Failed to convert stack-trace to string");
//             return null;
//         }
//     }
//     
// }


// Path: src/main/java/com/pearson/statspoller/utilities/network_utils/TcpClient.java
import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.io.BufferedWriter;
import java.io.DataOutputStream;
import java.io.OutputStreamWriter;
import java.net.InetSocketAddress;
import java.net.Socket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

        
        return isSendSuccess;
    }
    
    public boolean isConnected() {
        
        if (socket_ == null) {
            return false;
        }
        
        try {
            return (socket_.isConnected() && !socket_.isClosed());
        }
        catch (Exception e) {
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
            return false;
        }
        
    }
    
    public boolean isClosed() {
        
        if (socket_ == null) {
            return true;
        }
        
        try {
            return (socket_.isClosed());
        }
        catch (Exception e) {
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));