Documentation

Socket

A mockable wrapper around PHP "socket" or "file pointer" access.

Only the subset of socket actions required by Pheanstalk are provided.

Tags
author

Paul Annesley

license

http://www.opensource.org/licenses/mit-license.php

Table of Contents

disconnect()  : mixed
Disconnect the socket; subsequent usage of the socket will fail.
getLine()  : mixed
Reads up to the next new-line, or $length - 1 bytes.
read()  : string
Reads up to $length bytes from the socket.
write()  : void
Writes data to the socket.

Methods

disconnect()

Disconnect the socket; subsequent usage of the socket will fail.

public disconnect() : mixed
Return values
mixed

getLine()

Reads up to the next new-line, or $length - 1 bytes.

public getLine([mixed $length = null ]) : mixed

Trailing whitespace is trimmed.

Parameters
$length : mixed = null
Return values
mixed

read()

Reads up to $length bytes from the socket.

public read(mixed $length) : string
Parameters
$length : mixed
Return values
string

write()

Writes data to the socket.

public write(string $data) : void
Parameters
$data : string
Return values
void

Search results