<commit_before>/*
 * TCPServer.cpp
 *
 *  Created on: Apr 4, 2016
 *      Author: james
 */

#include "tcp/TCPDeviceServer.h"

#include <netinet/in.h>
#include <stddef.h>
#include <sys/socket.h>
#include <unistd.h>
#include <cstdint>
#include <iostream>
#include <utility>
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

#include "device/socket/tcp/TCPClient.h"
#include "device/socket/tcp/TCPClientProxy.h"
#include "Debug.h"
#include "tcp/TCPConnParams.h"
#include "tcp/SSLConfig.h"
#include "util/write.h"

TCPDeviceServer::TCPDeviceServer(Beetle &beetle, SSLConfig sslConfig, int port)
: beetle(beetle), sslConfig(sslConfig) {
	running = true;
	sockfd = -1;
	t = std::thread(&TCPDeviceServer::serverDaemon, this, port);
}

TCPDeviceServer::~TCPDeviceServer() {
	running = false;
	shutdown(sockfd, SHUT_RDWR);
	t.join();
}
<commit_msg>Change import.<commit_after>/*
 * TCPServer.cpp
 *
 *  Created on: Apr 4, 2016
 *      Author: james
 */

#include "tcp/TCPDeviceServer.h"

#include <netinet/in.h>
#include <stddef.h>
#include <sys/socket.h>
#include <unistd.h>
#include <cstdint>
#include <iostream>
#include <utility>
#include <openssl/bio.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

#include "device/socket/tcp/TCPClient.h"
#include "device/socket/tcp/TCPClientProxy.h"
#include "Debug.h"
#include "tcp/TCPConnParams.h"
#include "util/write.h"

TCPDeviceServer::TCPDeviceServer(Beetle &beetle, SSLConfig sslConfig, int port)
: beetle(beetle), sslConfig(sslConfig) {
	running = true;
	sockfd = -1;
	t = std::thread(&TCPDeviceServer::serverDaemon, this, port);
}

TCPDeviceServer::~TCPDeviceServer() {
	running = false;
	shutdown(sockfd, SHUT_RDWR);
	t.join();
}

{'fraction_non_alphanumeric': 0.1652989449003517, 'fraction_numerical': 0.007033997655334115, 'mean_word_length': 5.345724907063197, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5296083', 'n_tokens_mistral': 679, 'n_tokens_neox': 664, 'n_words': 129}