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.0a4

  • Support for encrypted connections. Note that due to known issues with PHP itself, encrypted connections may be unstable (as in "sometimes disconnect suddenly" or "sometimes hang when calling TcpClient::isDataAwaiting() without a timeout").
  • Stream::isAcceptingData() and Stream::isDataAwaiting() now accept an optional timeout, modeled after stream_select().
  • Changed sending to retry indefinetly unless the connection is broken, thanks to isDataAwaiting()'s new ability. Receiving can still timeout.
  • Chnaged the PHAR stub to not fail when reading the hash fails.
  • Doc and CS fixes.

Categories

Installation

$ php pyrus.phar install PEAR2_Net_Transmitter
Status: 1.0.0a4 alpha, released on August 15, 2013
License: LGPL License 2.1
Documentation: GitHub Wiki
Issues: none open
Maintainers:

Release History

1.0.0a4 alpha August 15, 2013
1.0.0a3 alpha August 3, 2012
1.0.0a2 alpha October 16, 2011
1.0.0a1 alpha September 27, 2011

Browse Files

29 files in 10 directories.

Dependencies for PEAR2_Net_Transmitter

  • PHP ≥ 5.3.0