Lines Matching defs:options
83 protected $options = [
99 * @param array $options
101 public function __construct($resource = null, array $options = [])
104 $this->options = \array_merge($this->options, $options);
105 if (!\in_array($this->options['transport'], self::TRANSPORTS, true)) {
108 $this->options['transport'],
126 while (\strlen((string) ($buffer = \fread($this->socket, $this->options['buffer_size']))) > 0) {
201 $result = \stream_socket_enable_crypto($this->socket, $encrypt, $this->options['ssl_crypto_type']);
223 $transport = $this->options['transport'];
224 if ($transport === 'tcp' && (bool) $this->options['use_ssl'] === true) {
231 $uri .= ':' . $this->options['port'];
238 $this->options['timeout_connect'],
251 $this->isEncrypted = $this->options['use_ssl'];
257 * Get the options set for the socket.
263 return $this->options;
270 * @param array $options
274 public static function create(string $host, array $options = []) : Socket
276 return (new self(null, $options))->connect($host);
283 * @param array $options Any additional options.
289 array $options = []
294 $options,
304 * @param array $options
308 public static function tcp(string $host, array $options = []) : Socket
310 return self::create($host, \array_merge($options, ['transport' => 'tcp']));
317 * @param array $options
321 public static function udp(string $host, array $options = []) : Socket
323 return self::create($host, \array_merge($options, [
336 if (isset($this->options[$optName])) {
337 $sslOpts[$sslOptsName] = $this->options[$optName];
340 if ($this->options['ssl_validate_cert'] === false) {
355 * Sets options on the stream that must be done after it is a resource.
359 \stream_set_timeout($this->socket, $this->options['timeout_read']);