Skip to content

Commit

Permalink
set TCP_NODELAY to true to fix PYCBC-32
Browse files Browse the repository at this point in the history
Also switched to socket.create_connection() for better
IP4/IP6 address handling.

Change-Id: I153d7e838132c7cb105ca8e77c41ce867a69d829
Reviewed-on: http://review.couchbase.org/20263
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>
Tested-by: Benjamin Young <benjamin@couchbase.com>
  • Loading branch information
BigBlueHat authored and Benjamin Young committed Aug 30, 2012
1 parent c316ce6 commit d3796c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions couchbase/memcachedclient.py
Expand Up @@ -40,8 +40,8 @@ def __init__(self, host='127.0.0.1', port=11210):
"""Memcached Binary Protocol Client"""
self.host = host
self.port = port
self.s = socket.socket()
self.s.connect_ex((host, port))
self.s.create_connection((host, port))
self.s.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
self.r = random.Random()
self.log = logger("MemcachedClient")
self.vbucket_count = 1024
Expand Down

0 comments on commit d3796c7

Please sign in to comment.