memcache connect vs addServer

Viewed 6292

I was looking at the php docs on memcache and noticed that instead of doing
$mem->connect('localhost', 11211) I can do instead
$mem->addServer('localhost', 11211)

And this way if I don't end up using the memcache connection, it won't bother connecting.

This got me wondering, why would someone ever use connect() over addServer()?

It just seems like a possible unnecessary connection. Am I missing something?

3 Answers
Related