2020-10-15 18:42:54 +02:00
|
|
|
---
|
|
|
|
title: danog\MadelineProto\Stream\MTProtoTransport\HttpStream: HTTP stream wrapper.
|
|
|
|
description:
|
|
|
|
|
|
|
|
---
|
|
|
|
# `danog\MadelineProto\Stream\MTProtoTransport\HttpStream`
|
|
|
|
[Back to index](../../../../index.md)
|
|
|
|
|
|
|
|
> Author: Daniil Gentili <daniil@daniil.it>
|
|
|
|
|
|
|
|
|
|
|
|
HTTP stream wrapper.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Method list:
|
|
|
|
* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator`
|
|
|
|
* `setExtra(array $extra): void`
|
|
|
|
* `disconnect(): \Amp\Promise`
|
|
|
|
* `getWriteBufferGenerator(int $length): \Generator`
|
|
|
|
* `getReadBufferGenerator(int $length): \Generator`
|
|
|
|
* `getSocket(): \Amp\Socket\EncryptableSocket`
|
|
|
|
* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface`
|
|
|
|
* `getReadBuffer(int $length): \Amp\Promise`
|
|
|
|
* `getWriteBuffer(int $length, string $append): \Amp\Promise`
|
|
|
|
|
|
|
|
## Methods:
|
|
|
|
### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator`
|
|
|
|
|
|
|
|
Connect to stream.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md)
|
|
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `setExtra(array $extra): void`
|
|
|
|
|
|
|
|
Set proxy data.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$extra`: `array` Proxy parameters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `disconnect(): \Amp\Promise`
|
|
|
|
|
|
|
|
Async close.
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Promise`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getWriteBufferGenerator(int $length): \Generator`
|
|
|
|
|
|
|
|
Get write buffer asynchronously.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$length`: `int` Length of data that is going to be written to the write buffer
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getReadBufferGenerator(int $length): \Generator`
|
|
|
|
|
|
|
|
Get read buffer asynchronously.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$length`: `int` Length of payload, as detected by this layer
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Generator`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getSocket(): \Amp\Socket\EncryptableSocket`
|
|
|
|
|
|
|
|
{@inheritdoc}
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Socket\EncryptableSocket`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface`
|
|
|
|
|
|
|
|
{@inheritDoc}
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### `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, string $append): \Amp\Promise`
|
|
|
|
|
|
|
|
Get write buffer asynchronously.
|
|
|
|
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
* `$length`: `int` Total length of data that is going to be piped in the buffer
|
|
|
|
* `$append`: `string` Data to append after entire buffer is written
|
|
|
|
|
|
|
|
|
|
|
|
#### See also:
|
|
|
|
* `\Amp\Promise`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-15 19:11:10 +02:00
|
|
|
---
|
|
|
|
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
|