1

k,所以我在以下方面遇到了一些麻烦

$this->cacheServers = array(
     array('test.com', 11211)
);

$this->memcache = new \Memcached();
$this->memcache->setOption( \Memcached::OPT_COMPRESSION, TRUE );
$this->memcache->setOption( \Memcached::OPT_LIBKETAMA_COMPATIBLE, TRUE );
$this->memcache->setOption( \Memcached::OPT_CACHE_LOOKUPS, TRUE );
$this->memcache->setOption( \Memcached::OPT_CONNECT_TIMEOUT, 50 );
$this->memcache->setOption( \Memcached::OPT_POLL_TIMEOUT, 50 );
$this->memcache->setOption( \Memcached::OPT_RECV_TIMEOUT, 10000 );
$this->memcache->setOption( \Memcached::OPT_SEND_TIMEOUT, 10000 );

$this->memcache->setOption( \Memcached::OPT_SERVER_FAILURE_LIMIT, 1 );
$this->memcache->setOption( \Memcached::OPT_RETRY_TIMEOUT, 50 );

$this->memcache->setOption( \Memcached::OPT_NO_BLOCK, TRUE );
$this->memcache->setOption( \Memcached::OPT_TCP_NODELAY, true );
$this->_data['connected'] = $this->memcache->addServers($this->cacheServers);

所以,我试图让它超时,但它只是挂起

4

1 回答 1

3

实现了我自己的 telnet 测试fsockopen和一秒超时。

再次回答我自己的问题

于 2012-04-23T20:48:54.930 回答