original_string: public function send(MessageInterface $message, $target)
      {
          $msg = $message->getMessageString();
          if (strpos($target, ':')) {
              list($host, $port) = explode(':', $target);
          } else {
              $host = $target;
              $port = self::DEFAULT_UDP_PORT;
          }
  
          $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
          if ($sock === false) {
              $errorCode = socket_last_error();
              $errorMsg = socket_strerror($errorCode);
              throw new \RuntimeException("Error creating socket: [$errorCode] $errorMsg");
          }
  
          socket_sendto($sock, $msg, strlen($msg), 0, $host, $port);
          socket_close($sock);
      }
code: public function send(MessageInterface $message, $target)
      {
          $msg = $message->getMessageString();
          if (strpos($target, ':')) {
              list($host, $port) = explode(':', $target);
          } else {
              $host = $target;
              $port = self::DEFAULT_UDP_PORT;
          }
  
          $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
          if ($sock === false) {
              $errorCode = socket_last_error();
              $errorMsg = socket_strerror($errorCode);
              throw new \RuntimeException("Error creating socket: [$errorCode] $errorMsg");
          }
  
          socket_sendto($sock, $msg, strlen($msg), 0, $host, $port);
          socket_close($sock);
      }
code_tokens: public function send ( MessageInterface $ message , $ target ) { $ msg = $ message -> getMessageString ( ) ; if ( strpos ( $ target , ':' ) ) { list ( $ host , $ port ) = explode ( ':' , $ target ) ; } else { $ host = $ target ; $ port = self :: DEFAULT_UDP_PORT ; } $ sock = socket_create ( AF_INET , SOCK_DGRAM , SOL_UDP ) ; if ( $ sock === false ) { $ errorCode = socket_last_error ( ) ; $ errorMsg = socket_strerror ( $ errorCode ) ; throw new \ RuntimeException ( "Error creating socket: [$errorCode] $errorMsg" ) ; } socket_sendto ( $ sock , $ msg , strlen ( $ msg ) , 0 , $ host , $ port ) ; socket_close ( $ sock ) ; }
docstring: Send the syslog to target host using the UDP protocol. Note that the UDP protocol
  is stateless, which means we can't confirm that the message was received by the
  other end
  @param  MessageInterface $message
  @param  string           $target  Host:port, if port not specified uses default 514
  @return void
  @throws \RuntimeException If there's an error creating the socket
docstring_tokens: Send the syslog to target host using the UDP protocol . Note that the UDP protocol is stateless which means we can t confirm that the message was received by the other end