Permalink
Browse files

set TCP_NODELAY to true to fix PYCBC-32

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...
1 parent c316ce6 commit d3796c7f21491b43ed9193849d88952d97225451 @BigBlueHat BigBlueHat committed with Benjamin Young Aug 28, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 couchbase/memcachedclient.py
@@ -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

0 comments on commit d3796c7

Please sign in to comment.