|
|
@ -20,17 +20,26 @@ class APIConnector |
|
|
protected $stream; |
|
|
protected $stream; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Constructor |
|
|
|
|
|
|
|
|
* APIConnector constructor. |
|
|
* |
|
|
* |
|
|
* @param StreamInterface $stream |
|
|
|
|
|
|
|
|
* @param \RouterOS\Interfaces\StreamInterface $stream |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
public function __construct(StreamInterface $stream) |
|
|
public function __construct(StreamInterface $stream) |
|
|
{ |
|
|
{ |
|
|
$this->stream = $stream; |
|
|
$this->stream = $stream; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* Close stream connection |
|
|
|
|
|
* |
|
|
|
|
|
* @return void |
|
|
|
|
|
*/ |
|
|
|
|
|
public function close(): void |
|
|
|
|
|
{ |
|
|
|
|
|
$this->stream->close(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
* Reads a WORD from the stream |
|
|
* Reads a WORD from the stream |
|
|
* |
|
|
* |
|
|
* WORDs are part of SENTENCE. Each WORD has to be encoded in certain way - length of the WORD followed by WORD content. |
|
|
* WORDs are part of SENTENCE. Each WORD has to be encoded in certain way - length of the WORD followed by WORD content. |
|
|
|