2020-10-15 18:42:54 +02:00
|
|
|
---
|
|
|
|
title: danog\MadelineProto\Stream\Common\BufferedRawStream: Buffered raw stream.
|
|
|
|
description:
|
|
|
|
|
|
|
|
---
|
|
|
|
# `danog\MadelineProto\Stream\Common\BufferedRawStream`
|
|
|
|
[Back to index](../../../../index.md)
|
|
|
|
|
|
|
|
> Author: Daniil Gentili <daniil@daniil.it>
|
|
|
|
|
|
|
|
|
|
|
|
Buffered raw stream.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Method list:
|
|
|
|
* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator`
|
|
|
|
* `read(): \Amp\Promise`
|
|
|
|
* `write(string $data): \Amp\Promise`
|
|
|
|
* `disconnect(): void`
|
|
|
|
* `getReadBuffer(int $length): \Amp\Promise`
|
|
|
|
* `getWriteBuffer(int $length): \Amp\Promise`
|
|
|
|
* `bufferRead(int $length): \Amp\Promise`
|
|
|
|
* `bufferReadGenerator(int $length): \Generator`
|
|
|
|
* `bufferWrite(string $data): \Amp\Promise`
|
|
|
|
* `bufferClear(): string`
|
|
|
|
* `getSocket(): \Amp\Socket\Socket`
|
|
|
|
* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface`
|
|
|
|
* `getName(): string`
|
|
|
|
|
|
|
|
## Methods:
|
|
|
|
### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator`
|
|
|
|
|
|
|
|
Asynchronously connect to a TCP/TLS server.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` Connection context
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md)
|
|
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `read(): \Amp\Promise`
|
|
|
|
|
|
|
|
Async chunked read.
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Promise`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `write(string $data): \Amp\Promise`
|
|
|
|
|
|
|
|
Async write.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$data`: `string` Data to write
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Promise`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `disconnect(): void`
|
|
|
|
|
|
|
|
Async close.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getReadBuffer(int $length): \Amp\Promise`
|
|
|
|
|
|
|
|
Get read buffer asynchronously.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$length`: `int` Length of payload, as detected by this layer
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\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`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `bufferRead(int $length): \Amp\Promise`
|
|
|
|
|
|
|
|
Read data asynchronously.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$length`: `int` Amount of data to read
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Promise`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `bufferReadGenerator(int $length): \Generator`
|
|
|
|
|
|
|
|
Read data asynchronously.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$length`: `int` Amount of data to read
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `bufferWrite(string $data): \Amp\Promise`
|
|
|
|
|
|
|
|
Async write.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$data`: `string` Data to write
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Promise`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `bufferClear(): string`
|
|
|
|
|
|
|
|
Get remaining data from buffer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getSocket(): \Amp\Socket\Socket`
|
|
|
|
|
|
|
|
{@inheritdoc}
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Socket\Socket`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface`
|
|
|
|
|
|
|
|
{@inheritDoc}
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getName(): string`
|
|
|
|
|
|
|
|
Get class name.
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|