function __construct($addr, $ctx = NULL, $wait = 60) { $this->addr = $addr; $this->ctx = $ctx ?: stream_context_create(); $this->wait = $wait; $this->events = []; }