<commit_before><?php
 
//Reduce errors
error_reporting(~E_WARNING);
 
//Create a UDP socket
if(!($sock = socket_create(AF_INET, SOCK_DGRAM, 0)))
{
    $errorcode = socket_last_error();
    $errormsg = socket_strerror($errorcode);
     
    die("Couldn't create socket: [$errorcode] $errormsg \n");
}
 
echo "Socket created \n";
 
// Bind the source address
if( !socket_bind($sock, "0.0.0.0" , 4000) )
{
    $errorcode = socket_last_error();
    $errormsg = socket_strerror($errorcode);
     
    die("Could not bind socket : [$errorcode] $errormsg \n");
}
 
echo "Socket bind OK \n";
 
//Do some communication, this loop can handle multiple clients
while(1)
{
  //echo "Waiting for data ... \n";
     
  //Receive some data
  $len = socket_recvfrom($sock, $buf, 1024, MSG_OOB, $remote_ip, $remote_port) != FALSE){
  
  echo "$remote_ip : $remote_port -- " . $buf. "\n";
     
    //Send back the data to the client
    //socket_sendto($sock, "OK " . $buf , 100 , 0 , $remote_ip , $remote_port);
}
 
socket_close($sock);<commit_msg>Update udp_socket_server.php<commit_after><?php
 
//Reduce errors
error_reporting(~E_WARNING);
 
//Create a UDP socket
if(!($sock = socket_create(AF_INET, SOCK_DGRAM, 0)))
{
    $errorcode = socket_last_error();
    $errormsg = socket_strerror($errorcode);
     
    die("Couldn't create socket: [$errorcode] $errormsg \n");
}
 
echo "Socket created \n";
 
// Bind the source address
if( !socket_bind($sock, "0.0.0.0" , 4000) )
{
    $errorcode = socket_last_error();
    $errormsg = socket_strerror($errorcode);
     
    die("Could not bind socket : [$errorcode] $errormsg \n");
}
 
echo "Socket bind OK \n";
 
//Do some communication, this loop can handle multiple clients
while(1)
{
  //echo "Waiting for data ... \n";
     
  //Receive some data
  $len = socket_recvfrom($sock, $buf, 1024, MSG_OOB, $remote_ip, $remote_port);
  
  echo "$remote_ip : $remote_port -- " . $buf. "\n";
     
    //Send back the data to the client
    //socket_sendto($sock, "OK " . $buf , 100 , 0 , $remote_ip , $remote_port);
}
 
socket_close($sock);
{'fraction_non_alphanumeric': 0.16158684083212385, 'fraction_numerical': 0.01741654571843251, 'mean_word_length': 3.353684210526316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1045976', 'n_tokens_mistral': 790, 'n_tokens_neox': 737, 'n_words': 191}