public void closeConnection() {
        //4: Closing connection
        try {
            if (in != null) {
                in.close();
            }
            if (out != null) {
                out.close();
            }
            if (providerSocket != null) {
                providerSocket.close();
            }
        } catch (IOException ioException) {
            ioException.printStackTrace();
        }
    }