PHP has built in support for various types of network streams, such as HTTP and TCP sockets. One problem that arises with them is the fact that a single fread/fwrite call might not read/write all the data you intended, regardless of whether you're in blocking mode or not. While the PHP manual offers a workaround in the form of a loop with a few variables, using it every single time you want to read/write can be tedious.

This package abstracts this away, so that when you want to get exactly N amount of bytes, you can be sure the upper levels of your app will be dealing with N bytes. Oh, and the functionality is nicely wrapped in an object (but that's just the icing on the cake).

Release Notes - 1.0.0a5

  • Added fragments to exceptions, allowing retrieval of incomplete receives' contents, and byte count on incomplete sends.
  • Changed Stream to use an fread/fwrite duo instead of stream_copy_to_stream() for the sake of stability.
  • Tweaked Stream::isAcceptingData() and NetworkStream::isAvailable(), in order to work around a reproducible hang on Linux.
  • Doc fixes.

Installation

$ php pyrus.phar install PEAR2_Net_Transmitter-1.0.0a5
Status: 1.0.0a5 alpha, released on November 2, 2014
License: LGPL License 2.1
Maintained: yes

Browse Files

30 files in 10 directories.

Dependencies for PEAR2_Net_Transmitter

  • PHP ≥ 5.3.0