2020-10-15 18:42:54 +02:00
|
|
|
---
|
|
|
|
title: danog\MadelineProto\Stream\BufferedStreamInterface: Buffered stream interface.
|
|
|
|
description:
|
|
|
|
|
|
|
|
---
|
|
|
|
# `danog\MadelineProto\Stream\BufferedStreamInterface`
|
|
|
|
[Back to index](../../../index.md)
|
|
|
|
|
|
|
|
> Author: Daniil Gentili <daniil@daniil.it>
|
|
|
|
|
|
|
|
|
|
|
|
Buffered stream interface.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Method list:
|
|
|
|
* `getReadBuffer(int $length): \Amp\Promise`
|
|
|
|
* `getWriteBuffer(int $length): \Amp\Promise`
|
|
|
|
* `getName(): string`
|
|
|
|
* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface`
|
|
|
|
* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator`
|
|
|
|
* `disconnect(): void`
|
|
|
|
* `getSocket(): \Amp\Socket\EncryptableSocket`
|
|
|
|
|
|
|
|
## Methods:
|
|
|
|
### `getReadBuffer(int $length): \Amp\Promise`
|
|
|
|
|
|
|
|
Get read buffer asynchronously.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$length`: `int` Length of payload, as detected by this layer
|
|
|
|
|
|
|
|
|
|
|
|
Fully typed return value:
|
|
|
|
```
|
|
|
|
\Amp\Promise<\danog\MadelineProto\Stream\BufferInterface>
|
|
|
|
```
|
|
|
|
#### See also:
|
|
|
|
* [`\danog\MadelineProto\Stream\BufferInterface`: Buffer interface.](./BufferInterface.md)
|
|
|
|
* `\Amp\Promise`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getWriteBuffer(int $length): \Amp\Promise`
|
|
|
|
|
|
|
|
Get write buffer asynchronously.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$length`: `int` Total length of data that is going to be piped in the buffer
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Promise`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getName(): string`
|
|
|
|
|
|
|
|
Get stream name.
|
|
|
|
Is supposed to return __CLASS__
|
|
|
|
|
|
|
|
|
|
|
|
### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface`
|
|
|
|
|
|
|
|
Get underlying stream resource.
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](./RawStreamInterface.md)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator`
|
|
|
|
|
|
|
|
Connect to a server.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md)
|
|
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `disconnect(): void`
|
|
|
|
|
|
|
|
Disconnect from the server.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getSocket(): \Amp\Socket\EncryptableSocket`
|
|
|
|
|
|
|
|
Get underlying AMPHP socket resource.
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Socket\EncryptableSocket`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|