PHP Class Workerman\Connection\UdpConnection

Inheritance: extends Workerman\Connection\ConnectionInterface
Show file Open project: walkor/workerman

Public Properties

Property Type Description
$protocol Workerman\Protocols\ProtocolInterface The format is like this Workerman\\Protocols\\Http.

Protected Properties

Property Type Description
$_remoteAddress string Remote address.
$_socket resource Udp socket.

Public Methods

Method Description
__construct ( resource $socket, string $remote_address ) Construct.
close ( mixed $data = null, boolean $raw = false ) : boolean Close connection.
getRemoteIp ( ) : string Get remote IP.
getRemotePort ( ) : integer Get remote port.
send ( string $send_buffer, boolean $raw = false ) : void | boolean Sends data on the connection.

Method Details

__construct() public method

Construct.
public __construct ( resource $socket, string $remote_address )
$socket resource
$remote_address string

close() public method

Close connection.
public close ( mixed $data = null, boolean $raw = false ) : boolean
$data mixed
$raw boolean
return boolean

getRemoteIp() public method

Get remote IP.
public getRemoteIp ( ) : string
return string

getRemotePort() public method

Get remote port.
public getRemotePort ( ) : integer
return integer

send() public method

Sends data on the connection.
public send ( string $send_buffer, boolean $raw = false ) : void | boolean
$send_buffer string
$raw boolean
return void | boolean

Property Details

$_remoteAddress protected property

Remote address.
protected string $_remoteAddress
return string

$_socket protected property

Udp socket.
protected resource $_socket
return resource

$protocol public property

The format is like this Workerman\\Protocols\\Http.
public ProtocolInterface,Workerman\Protocols $protocol
return Workerman\Protocols\ProtocolInterface