<commit_before>#include "net.h"

void init_network(void)
{
	int port, opts;
	struct hostent *server;

	char *host = TEST_HOST;
	port = TEST_PORT;

	memset(&server_addr, '\0', sizeof(server_addr));

	sockfd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
	if((server = gethostbyname(host)) == NULL)
	{
		perror("gethostbyname() failed");
		return;
	}
	
	memcpy(&server_addr.sin_addr, server->h_addr_list[0], server->h_length);
	server_addr.sin_family = PF_INET;
	server_addr.sin_port = htons(port);

}

int recv_message(char *buffer)
{
	int n;

	if(sockfd <= 0)
	{
		return;
	}

	n=recv(sockfd,buffer,strlen(buffer),0);
	return n;
}

int send_message(char *buffer)
{
	int n;
	int saddr_len = sizeof(server_addr);

	if(sockfd <= 0)
	{
		return;
	}

	n = sendto(sockfd,buffer,strlen(buffer),0,&server_addr,saddr_len);
	return n;
}<commit_msg>typecasted socklen_t<commit_after>#include "net.h"

void init_network(void)
{
	int port, opts;
	struct hostent *server;

	char *host = TEST_HOST;
	port = TEST_PORT;

	memset(&server_addr, '\0', sizeof(server_addr));

	sockfd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
	if((server = gethostbyname(host)) == NULL)
	{
		perror("gethostbyname() failed");
		return;
	}
	
	memcpy(&server_addr.sin_addr, server->h_addr_list[0], server->h_length);
	server_addr.sin_family = PF_INET;
	server_addr.sin_port = htons(port);

}

int recv_message(char *buffer)
{
	int n;

	if(sockfd <= 0)
	{
		return;
	}

	n=recv(sockfd,buffer,strlen(buffer),0);
	return n;
}

int send_message(char *buffer)
{
	int n;
	int saddr_len = sizeof(server_addr);

	if(sockfd <= 0)
	{
		return;
	}

	n = sendto(sockfd,buffer,strlen(buffer),0,(struct sockaddr *)&server_addr,(socklen_t)saddr_len);
	return n;
}
{'fraction_non_alphanumeric': 0.1552431165787932, 'fraction_numerical': 0.007029876977152899, 'mean_word_length': 5.188405797101449, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7403845', 'n_tokens_mistral': 742, 'n_tokens_neox': 721, 'n_words': 125}