PHPackages                             varion/driver-stream - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. varion/driver-stream

ActiveLibrary[API Development](/categories/api)

varion/driver-stream
====================

PHP stream driver for the Varion Transport API

v0.1.0(3mo ago)00MITPHPPHP ^8.1

Since Mar 7Pushed 3mo agoCompare

[ Source](https://github.com/varionlabs/driver-stream)[ Packagist](https://packagist.org/packages/varion/driver-stream)[ RSS](/packages/varion-driver-stream/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

varion/driver-stream
====================

[](#variondriver-stream)

`varion/driver-stream` is a stream-based transport driver for the experimental Varion Transport API.

It is the first concrete driver implementation for `varion/transport-contracts`, built only with standard PHP stream/socket functions.

Scope
-----

[](#scope)

This package currently provides:

- outgoing TCP connections
- listening TCP servers
- read/write operations
- close operations
- local/remote address retrieval

This is a v0.1 reference implementation and uses blocking I/O by default.

Requirements
------------

[](#requirements)

- PHP `^8.1`
- `varion/transport-contracts` `^0.1`

Supported options
-----------------

[](#supported-options)

### `StreamDriver::connect(string $uri, array $options = [])`

[](#streamdriverconnectstring-uri-array-options--)

- `timeout` (`int|float`): connection timeout seconds
- `context` (`array`): stream context options
- `flags` (`int`): flags for `stream_socket_client()`
- `blocking` (`bool`): applies `stream_set_blocking()` after connection

### `StreamDriver::listen(string $uri, array $options = [])`

[](#streamdriverlistenstring-uri-array-options--)

- `context` (`array`): stream context options
- `flags` (`int`): flags for `stream_socket_server()`
- `backlog` (`int`): mapped to `context['socket']['backlog']`
- `blocking` (`bool`): applies `stream_set_blocking()` after listener creation

Usage
-----

[](#usage)

```
