Amp\Artax\SocketPool::setOption PHP Method

setOption() public method

Set socket pool options
public setOption ( integer $option, mixed $value ) : self
$option integer
$value mixed
return self
    public function setOption($option, $value)
    {
        switch ($option) {
            case self::OP_HOST_CONNECTION_LIMIT:
                $this->options[self::OP_HOST_CONNECTION_LIMIT] = (int) $value;
                break;
            case self::OP_MS_CONNECT_TIMEOUT:
                $this->options[self::OP_MS_CONNECT_TIMEOUT] = $value;
                break;
            case self::OP_MS_IDLE_TIMEOUT:
                $this->options[self::OP_MS_IDLE_TIMEOUT] = (int) $value;
                break;
            case self::OP_BINDTO:
                $this->options[self::OP_BINDTO] = $value;
                break;
            default:
                throw new \DomainException(sprintf('Unknown option: %s', $option));
        }
        return $this;
    }