Ferreteria/v0.6/clade/IO/Aspect/Connx/Stream
Jump to navigation
Jump to search
| ||||||||||||||||||||
Thinking
- 2025-12-17 I guess I'll go with the idea that a stream can be bidirectional -- so methods are available for both -- but it may need to be configured for how you're using it
Code
interface iStream extends BaseIface, RdouterIface {
// STATUS
function MoreBytes() : bool;
function NPulledBytes() : int; // bytes already processed/transferred (read or written)
// ACTION (I/O)
function PullBytes(int $nMax=NULL) : CommOpIface;
function PushBytes(string $s) : int|null; // add on as new bytes
}
abstract class caStream extends BaseClass implements iStream {
use RdouterTrait;
// ++ CONFIG ++ //
protected function InspectorClass() : string { return InspectClass::class; }
// -- CONFIG -- //
// ++ STATUS ++ //
protected $nPulled = 0;
public function NPulledBytes() : int { return $this->nPulled; }
protected function ResetPulled() { $this->nPulled = 0; }
// -- STATUS -- //
}