BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
UDPTransport Class Reference

Public Member Functions

 __construct ($host, $port, $domain, $prefix=false)
 
 emit ($text)
 

Static Public Member Functions

static newFromString ($info)
 

Public Attributes

 $port
 
 $prefix
 
 $domain
 

Detailed Description

A generic class to send a message over UDP

If a message prefix is provided to the constructor or via UDPTransport::newFromString(), the payload of the UDP datagrams emitted will be formatted with the prefix and a single space at the start of each line. This is the payload format expected by the udp2log service.

Since
1.25

Constructor & Destructor Documentation

UDPTransport::__construct (   $host,
  $port,
  $domain,
  $prefix = false 
)
Parameters
string$hostIP address to send to
int$portport number
int$domainAF_INET or AF_INET6 constant
string | bool$prefixPrefix to use, false for no prefix

Member Function Documentation

UDPTransport::emit (   $text)
Parameters
string$text
static UDPTransport::newFromString (   $info)
static
Parameters
string$infoIn the format of "udp://host:port/prefix"
Returns
UDPTransport
Exceptions
InvalidArgumentException

The documentation for this class was generated from the following file: