public function addConnectionFlag($connectionFlag)
    {
        if (!in_array($connectionFlag, array(
                STREAM_CLIENT_CONNECT,
                STREAM_CLIENT_PERSISTENT,
                STREAM_CLIENT_ASYNC_CONNECT
            )
        )) {
            throw new \InvalidArgumentException('Invalid connection flag argument');
        }

        if (!in_array($connectionFlag, $this->connectionFlags)) {
            $this->connectionFlags[] = $connectionFlag;
        }

        return $this;
    }