generated from Nodarx/template
32 lines
805 B
PHP
32 lines
805 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KTXM\ProviderImap\Client\Transport;
|
|
|
|
use KTXM\ProviderImap\Client\ConnectionConfig;
|
|
|
|
interface ConnectionInterface
|
|
{
|
|
public function connect(ConnectionConfig $config): void;
|
|
|
|
public function disconnect(): void;
|
|
|
|
public function isConnected(): bool;
|
|
|
|
public function write(string $payload): void;
|
|
|
|
public function readLine(): string;
|
|
|
|
public function readBytes(int $length): string;
|
|
|
|
/**
|
|
* Yield the literal payload in chunks without buffering the full content.
|
|
* Reads exactly $length bytes from the socket, never crossing the literal boundary.
|
|
*
|
|
* @return \Generator<string>
|
|
*/
|
|
public function readBytesChunked(int $length, int $chunkSize = 8192): \Generator;
|
|
|
|
public function upgradeToTls(): void;
|
|
} |