<commit_before>// SyncTestEchoClient.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include "boost/asio.hpp"

using boost::asio::ip::tcp;

const std::string SERVER_IP = "127.0.0.1";
const unsigned short SERVER_PORT = 7777;

int main()
{	
	boost::asio::io_service ios;
			
	tcp::endpoint endpoint(boost::asio::ip::address::from_string(SERVER_IP), SERVER_PORT);	
	tcp::socket socket(ios);

	boost::system::error_code error_code;
	socket.connect(endpoint, error_code);

	if (error_code)
	{
		std::cout << "failed to connect : " << error_code.message() << error_code.value() << std::endl;
		//10061 :   ־  ȵǴ   :  ǻͿ  ź  ߽ϴ		
		getchar();
	}
	else
	{
		std::cout << "succed to connect" << std::endl;
	}

		
	for (;;)
	{
		std::string msg;
		std::cin >> msg;

		socket.write_some(boost::asio::buffer(msg), error_code);
		if (error_code)
		{
			if (error_code == boost::asio::error::eof)
			{
				std::cout << error_code.message() << std::endl;
				std::cout << "disconnected" << std::endl;
				//10054 :  Ǿ,  ⳪ ٿȰ, 
				//r/w Ҽ  "    ȣƮ   ϴ. ޽ Ե"
			}
			else
			{
				std::cout << "msg id : " << error_code.value() << " error message : " << error_code.message() << std::endl;
			}
		}
		
		std::array<char, 128> readBuff;
		readBuff.assign(0);		
		socket.read_some(boost::asio::buffer(readBuff), error_code);

		if (error_code)
		{
			if (error_code == boost::asio::error::eof)
			{
				std::cout << error_code.message() << std::endl;
				std::cout << "disconnected" << std::endl;
			}
			else
			{
				std::cout << "msg id : " << error_code.value() << " error message : " << error_code.message() << std::endl;
			}
		}

		std::cout << "Msg : " << readBuff.data() << std::endl;;
	}

    return 0;
}

<commit_msg>add socket.close(), if connected to server after send message<commit_after>// SyncTestEchoClient.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include "boost/asio.hpp"

using boost::asio::ip::tcp;

const std::string SERVER_IP = "127.0.0.1";
const unsigned short SERVER_PORT = 7777;

int main()
{	
	boost::asio::io_service ios;
			
	tcp::endpoint endpoint(boost::asio::ip::address::from_string(SERVER_IP), SERVER_PORT);	
	tcp::socket socket(ios);

	boost::system::error_code error_code;
	socket.connect(endpoint, error_code);

	if (error_code)
	{
		std::cout << "failed to connect : " << error_code.message() << error_code.value() << std::endl;
		//10061 :   ־  ȵǴ   :  ǻͿ  ź  ߽ϴ		
		getchar();
	}
	else
	{
		std::cout << "succed to connect" << std::endl;
	}

		
	for (;;)
	{
		std::string msg;
		std::cin >> msg;

		socket.write_some(boost::asio::buffer(msg), error_code);
		if (error_code)
		{
			if (error_code == boost::asio::error::eof)
			{
				std::cout << error_code.message() << std::endl;
				std::cout << "disconnected" << std::endl;
				//10054 :  Ǿ,  ⳪ ٿȰ, 
				//r/w Ҽ  "    ȣƮ   ϴ. ޽ Ե"
			}
			else
			{
				std::cout << "msg id : " << error_code.value() << " error message : " << error_code.message() << std::endl;
			}
		}
		
		std::array<char, 128> readBuff;
		readBuff.assign(0);		
		socket.read_some(boost::asio::buffer(readBuff), error_code);

		if (error_code)
		{
			if (error_code == boost::asio::error::eof)
			{
				std::cout << error_code.message() << std::endl;
				std::cout << "disconnected" << std::endl;
			}
			else
			{
				std::cout << "msg id : " << error_code.value() << " error message : " << error_code.message() << std::endl;
			}
		}

		std::cout << "Msg : " << readBuff.data() << std::endl;;


		if (socket.is_open())
		{
			socket.close();
		}

	}
    return 0;
}


{'fraction_non_alphanumeric': 0.19388038942976357, 'fraction_numerical': 0.013908205841446454, 'mean_word_length': 3.3640776699029127, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4665048', 'n_tokens_mistral': 1623, 'n_tokens_neox': 1407, 'n_words': 271}