EventBase::stop
EventBuffer::add
Event
PHP Manual

# The EventBuffer class

(PECL event >= 1.5.0)

## Introduction

EventBuffer represents Libevent's "evbuffer", an utility functionality for buffered I/O.

Event buffers are meant to be generally useful for doing the "buffer" part of buffered network I/O.

## Synopsis de la classe

EventBuffer {
/* Constants */
const integer EOL_ANY = 0 ;
const integer EOL_CRLF = 1 ;
const integer EOL_CRLF_STRICT = 2 ;
const integer EOL_LF = 3 ;
const integer PTR_SET = 0 ;
const integer PTR_ADD = 1 ;
/* Propriétés */
public readonly int $length ;
public readonly int $contiguous_space ;
/* Méthodes */
public bool add ( string `$data` )
public bool addBuffer ( EventBuffer `$buf` )
public int appendFrom ( EventBuffer `$buf` , int `$len` )
public __construct ( void )
public int copyout ( string `&$data` , int `$max_bytes` )
public void drain ( int `$len` )
public void enableLocking ( void )
public bool expand ( int `$len` )
public bool freeze ( bool `$at_front` )
public void lock ( void )
public bool prepend ( string `$data` )
public bool prependBuffer ( EventBuffer `$buf` )
public void pullup ( string `$size` )
public string read ( int `$max_bytes` )
public string read ( mixed `$fd` , int `$howmuch` )
public void readLine ( string `$eol_style` )
public mixed search ( string `$what` [, int `$start` = -1 [, int `$end` = -1 ]] )
public mixed searchEol ([ int `$start` = -1 [, int `$eol_style` = `EventBuffer::EOL_ANY` ]] )
public string substr ( int `$start` [, int `$length` ] )
public bool unfreeze ( bool `$at_front` )
public bool unlock ( void )
public void write ( mixed `$fd` [, int `$howmuch` ] )
}

## Propriétés

length

  The number of bytes stored in an event buffer.

contiguous_space

  The number of bytes stored contiguously at the front of the buffer. The bytes in a buffer may be stored in multiple separate chunks of memory; the property returns the number of bytes currently stored in the first chunk.

## Constantes pré-définies

`EventBuffer::EOL_ANY`

  The end of line is any sequence of any number of carriage return and linefeed characters. This format is not very useful; it exists mainly for backward compatibility.

`EventBuffer::EOL_CRLF`

  The end of the line is an optional carriage return, followed by a linefeed. (In other words, it is either a "\r\n" or a "\n" .) This format is useful in parsing text-based Internet protocols, since the standards generally prescribe a "\r\n" line-terminator, but nonconformant clients sometimes say just "\n" .

`EventBuffer::EOL_CRLF_STRICT`

  The end of a line is a single carriage return, followed by a single linefeed. (This is also known as "\r\n" . The ASCII values are `0x0D` `0x0A` ).

`EventBuffer::EOL_LF`

  The end of a line is a single linefeed character. (This is also known as "\n" . It is ASCII value is `0x0A` .)

`EventBuffer::PTR_SET`

  Flag used as argument of EventBuffer::setPosition() method. If this flag specified, the position pointer is moved to an absolute position within the buffer.

`EventBuffer::PTR_ADD`

  The same as `EventBuffer::PTR_SET` , except this flag causes EventBuffer::setPosition() method to move position forward up to the specified number of bytes(instead of setting absolute position).

## Sommaire

- EventBuffer::add — Ajoute des données à la fin du tampon d'événement
- EventBuffer::addBuffer — Déplace toutes les données du tampon fourni dans l'instance courante EventBuffer
- EventBuffer::appendFrom — Déplace le nombre d'octets fourni depuis un tampon source vers la fin du tampon courant
- EventBuffer::__construct — Construit un objet EventBuffer
- EventBuffer::copyout — Copie le nombre d'octets spécifié depuis le début du tampon
- EventBuffer::drain — Supprime un nombre spécifié d'octets depuis le début du tampon sans copier les données
- EventBuffer::enableLocking — Description
- EventBuffer::expand — Réserve de l'espace dans le tampon
- EventBuffer::freeze — Permet d'empécher les appels qui tentent de modifier un tampon d'événements de réussir
- EventBuffer::lock — Acquires a lock on buffer
- EventBuffer::prepend — Prepend data to the front of the buffer
- EventBuffer::prependBuffer — Moves all data from source buffer to the front of current buffer
- EventBuffer::pullup — Linearizes data within buffer and returns it's contents as a string
- EventBuffer::read — Lit les données d'un evbuffer, et vide les octets lus
- EventBuffer::readFrom — Lit des données depuis un fichier et les place à la fin du tampon
- EventBuffer::readLine — Extrait une ligne depuis le début du tampon
- EventBuffer::search — Recherche dans le tampon une occurrence d'une chaîne
- EventBuffer::searchEol — Cherche dans le tampon une occurrence de fin de ligne
- EventBuffer::substr — Soustrait une portion des données du tampon
- EventBuffer::unfreeze — Re-enable calls that modify an event buffer
- EventBuffer::unlock — Releases lock acquired by EventBuffer::lock
- EventBuffer::write — Write contents of the buffer to a file or socket

EventBase::stop
EventBuffer::add
Event
PHP Manual