GithubHelp home page GithubHelp logo

esnme / ultramemcache Goto Github PK

View Code? Open in Web Editor NEW
262.0 262.0 53.0 106 KB

Ultra fast memcache client written in highly optimized C++ with Python bindings.

C++ 74.52% C 6.18% Python 19.30%
c-plus-plus memcached python

ultramemcache's People

Contributors

ekleog avatar fcicq avatar jahaja avatar noonat avatar rbranson avatar rfk avatar snews avatar tarekziade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ultramemcache's Issues

Not gevent compatible?

I see ultrememcache is mentioned in the gevent page:
https://github.com/SiteSupport/gevent/wiki/Projects

However running a few parallel greenlets using umemcache breaks it.. see errors below.
The test script uses python-memcached as a baseline to compare.

Or maybe I'm just doing something wrong?

Thanks.

import gevent
from gevent import monkey; monkey.patch_all()
from gevent.pool import Pool

import hashlib
import memcache
import umemcache

HOST = '127.0.0.1:11211'

mc_pymemcache = memcache.Client([HOST])
mc_umemcache = umemcache.Client(HOST)
mc_umemcache.connect()

def test(mc):
    for i in xrange(1000):
        key = hashlib.md5(str(i)).hexdigest()
        mc.set(key, "TEST VALUE")
        mc.get(key)

def concurrize(mc):
    pool = Pool(10)
    jobs = [pool.spawn(test, mc) for i in range(10)]
    pool.join()

if __name__ == '__main__':
    print mc_pymemcache
    concurrize(mc_pymemcache)
    print mc_umemcache
    concurrize(mc_umemcache)

Errors:

$ python mc_gevent.py                                                                                                                                             
<memcache.Client object at 0x1007b14c8>
<umemcache.Client object at 0x1007b1f50>
Traceback (most recent call last):
  File "/Users/adamjlev/web/ve/lib/python2.7/site-packages/gevent/greenlet.py", line 328, in run
    result = self._run(*self.args, **self.kwargs)
  File "mc_gevent.py", line 21, in test
    mc.get(key)
RuntimeError: umemcache: Unspecified error
<Greenlet at 0x10126d4b0: test(<umemcache.Client object at 0x1007b1f50>)> failed with RuntimeError

Traceback (most recent call last):
  File "/Users/adamjlev/web/ve/lib/python2.7/site-packages/gevent/greenlet.py", line 328, in run
    result = self._run(*self.args, **self.kwargs)
  File "mc_gevent.py", line 21, in test
    mc.get(key)
  File "/Users/adamjlev/web/ve/lib/python2.7/site-packages/gevent/socket.py", line 393, in recv
    self._wait(self._read_event)
  File "/Users/adamjlev/web/ve/lib/python2.7/site-packages/gevent/socket.py", line 290, in _wait
    assert watcher.callback is None, 'This socket is already used by another greenlet: %r' % (watcher.callback, )
AssertionError: This socket is already used by another greenlet: <bound method Waiter.switch of <gevent.hub.Waiter object at 0x1007cb640>>
<Greenlet at 0x10126d410: test(<umemcache.Client object at 0x1007b1f50>)> failed with AssertionError

Traceback (most recent call last):
  File "/Users/adamjlev/web/ve/lib/python2.7/site-packages/gevent/greenlet.py", line 328, in run
    result = self._run(*self.args, **self.kwargs)
  File "mc_gevent.py", line 20, in test
    mc.set(key, "TEST VALUE")
IOError: No client object
<Greenlet at 0x10126d370: test(<umemcache.Client object at 0x1007b1f50>)> failed with IOError

Does it not supports connect via unix domain socket?

Start process

memcached -s /tmp/mc.sock

Test code

import umemcache

mc = umemcache.Client('unix:/tmp/mc.sock')
mc.connect()

print mc.set('a', 'b')

Got exception

Traceback (most recent call last):
  File "t.py", line 4, in <module>
    mc.connect()
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

support for Python 3.2+

Python 3.2.3 (default, May 3 2012, 15:54:42)

$ sudo python3 setup.py install
running install
running build
running build_ext
building 'umemcache' extension
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -DWIN32_LEAN_AND_MEAN -I./lib/ -I/usr/include/python3.2mu -c ./python/umemcache.cpp -o build/temp.linux-i686-3.2/./python/umemcache.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
./python/umemcache.cpp: In function ‘int API_send(SOCKETDESC_, void_, size_t)’:
./python/umemcache.cpp:77:39: error: ‘PyString_FromString’ was not declared in this scope
./python/umemcache.cpp:78:63: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp:88:31: error: ‘PyInt_AsLong’ was not declared in this scope
./python/umemcache.cpp: In function ‘int API_recv(SOCKETDESC_, void_, size_t)’:
./python/umemcache.cpp:110:39: error: ‘PyString_FromString’ was not declared in this scope
./python/umemcache.cpp:111:37: error: ‘PyInt_FromLong’ was not declared in this scope
./python/umemcache.cpp:121:36: error: ‘PyString_GET_SIZE’ was not declared in this scope
./python/umemcache.cpp:122:39: error: ‘PyString_AS_STRING’ was not declared in this scope
./python/umemcache.cpp: In function ‘int API_connect(SOCKETDESC_, const char_, int)’:
./python/umemcache.cpp:150:3: error: ‘PyInt_FromLong’ was not declared in this scope
./python/umemcache.cpp:151:51: error: ‘PyString_FromString’ was not declared in this scope
./python/umemcache.cpp: In function ‘int Client_init(PyClient_, PyObject_)’:
./python/umemcache.cpp:264:70: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_connect(PyClient_, PyObject_)’:
./python/umemcache.cpp:301:60: error: ‘PyString_AS_STRING’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_command(PyClient_, PFN_COMMAND, PyObject_)’:
./python/umemcache.cpp:362:58: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp:346:8: warning: unused variable ‘bAsync’ [-Wunused-variable]
./python/umemcache.cpp: In function ‘PyObject* Client_get(PyClient_, PyObject_)’:
./python/umemcache.cpp:436:62: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp:437:42: error: ‘PyInt_FromLong’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_gets(PyClient_, PyObject_)’:
./python/umemcache.cpp:499:62: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp:500:42: error: ‘PyInt_FromLong’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_get_multi(PyClient_, PyObject_)’:
./python/umemcache.cpp:550:27: error: ‘PyString_Check’ was not declared in this scope
./python/umemcache.cpp:559:54: error: ‘PyString_AS_STRING’ was not declared in this scope
./python/umemcache.cpp:559:79: error: ‘PyString_GET_SIZE’ was not declared in this scope
./python/umemcache.cpp:577:61: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp:580:44: error: ‘PyInt_FromLong’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_gets_multi(PyClient_, PyObject_)’:
./python/umemcache.cpp:631:27: error: ‘PyString_Check’ was not declared in this scope
./python/umemcache.cpp:640:54: error: ‘PyString_AS_STRING’ was not declared in this scope
./python/umemcache.cpp:640:79: error: ‘PyString_GET_SIZE’ was not declared in this scope
./python/umemcache.cpp:658:61: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp:661:44: error: ‘PyInt_FromLong’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_delete(PyClient_, PyObject_)’:
./python/umemcache.cpp:719:58: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp:695:7: warning: unused variable ‘flags’ [-Wunused-variable]
./python/umemcache.cpp: In function ‘PyObject* Client_cas(PyClient_, PyObject_)’:
./python/umemcache.cpp:766:58: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_incr(PyClient_, PyObject_)’:
./python/umemcache.cpp:815:58: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_decr(PyClient_, PyObject_)’:
./python/umemcache.cpp:863:58: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_version(PyClient_, PyObject_)’:
./python/umemcache.cpp:884:56: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp: In function ‘PyObject* Client_stats(PyClient_, PyObject_)’:
./python/umemcache.cpp:903:64: error: ‘PyString_FromStringAndSize’ was not declared in this scope
./python/umemcache.cpp: At global scope:
./python/umemcache.cpp:1002:1: warning: missing braces around initializer for ‘PyObject {aka object}’ [-Wmissing-braces]
./python/umemcache.cpp:1002:1: error: invalid conversion from ‘const char
’ to ‘Py_ssize_t {aka int}’ [-fpermissive]
./python/umemcache.cpp:1002:1: error: invalid conversion from ‘destructor {aka void ()(object)}’ to ‘printfunc {aka int ()(object, IO_FILE, int)}’ [-fpermissive]
./python/umemcache.cpp:1002:1: error: invalid conversion from ‘long int’ to ‘const char_’ [-fpermissive]
./python/umemcache.cpp:1002:1: error: cannot convert ‘const char_’ to ‘traverseproc {aka int ()(object, int ()(object, void_), void_)}’ in initialization
./python/umemcache.cpp:1002:1: error: cannot convert ‘PyMethodDef_’ to ‘PyMemberDef_’ in initialization
./python/umemcache.cpp:1002:1: error: invalid conversion from ‘initproc {aka int ()(object, object, object)}’ to ‘allocfunc {aka object* ()(typeobject, int)}’ [-fpermissive]
./python/umemcache.cpp: In function ‘PyObject* initumemcache()’:
./python/umemcache.cpp:1015:7: error: ‘Py_InitModule3’ was not declared in this scope
./python/umemcache.cpp:1017:5: error: return-statement with no value, in function returning ‘PyObject* {aka object}’ [-fpermissive]
./python/umemcache.cpp:1021:5: error: return-statement with no value, in function returning ‘PyObject
{aka object}’ [-fpermissive]
./python/umemcache.cpp:1024:1: warning: no return statement in function returning non-void [-Wreturn-type]
./python/umemcache.cpp: In function ‘PyObject_ Client_version(PyClient_, PyObject_)’:
./python/umemcache.cpp:885:1: warning: control reaches end of non-void function [-Wreturn-type]
error: command 'gcc' failed with exit status 1

Heroku support

I would like to use ultramemcache on the Heroku hosting framework.
The requirements are that the client will use the binary protocol and support SASL.
Does ultramemcache support those? and if not, can the support be added?

Connection and command timeout

Hi guys,

This is a great project, that will help a lot when moving to greenlets in the future.

While evaluating ultramemcache I was looking for a way to specify the connection timeout and also the command timeout, but did not find such thing. Is there a way to do this?

In case this is not part of the lib yet, can it be added?

Many thanks,
Ciprian

gets_multi behavior seems odd

Getting some weird behavior when trying to use gets_multi (normal gets+cas works fine).
I might be doing it wrong?

import umemcache
mc = umemcache.Client("127.0.0.1:11211")
mc.connect()
mc.set("test1", "1")
mc.set("test2"," 1")
d =  mc.gets_multi(["test1", "test2"])
print mc.cas("test1", "2", d["test1"][2])
##
print mc.gets("test1")
print mc.gets("test2")
print mc.gets_multi(["test1", "test2"])

output:

EXISTS
('1', 0, 2290L)
(' 1', 0, 2291L)
{'test1': ('1', 0, 140734726660512L), 'test2': (' 1', 0, 140734726660512L)}

There is something fishy about the cas_ids for the results in gets_multi. Via telnet:

gets test1 test2
VALUE test1 0 1 2290
1
VALUE test2 0 2 2291
 1
END

Handling reconnections

Right now with a connected client, if the server is restart, the client will break. IOW if the server blips the connector is broken.

It's happening to us in the Django memcached pool I wrote: https://github.com/mozilla/django-memcached-pool

Since I am keeping open connections, it's important for me to be able to respawn the connections when the server has restarted.

I am working on a ReconnectClient class that attempts to reconnect and replay the query in case there's an error.

@jskorpan are you interested in this feature for integration in umemcache ?

Compiling or installing through pip errors

Not sure if anyone else has tested this, but after the repackage for pip, I can't seem to install this anymore. While running the build through pip, gcc exits with the error: "error: expected constructor, destructor, or type conversion before ‘*’ token".

CAS doesn't work with Couchbase 2.0

Ubuntu 12.04 64-bit. We were using ultramemcache quite happily with Couchbase 1.8.1. I seem to recall 1.8.1 generating relatively short CAS values (maybe 5 digits). 2.0 is now generating large CAS values, larger than 32 bits, which may be what's causing the problem. CAS does work correctly when passing zero for the CAS value. Any chance of this getting fixed?

Does not install on Mac OS X Mavericks

running build

running build_ext

building 'umemcache' extension

creating build

creating build/temp.macosx-10.9-intel-2.7

creating build/temp.macosx-10.9-intel-2.7/python

creating build/temp.macosx-10.9-intel-2.7/lib

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wsho

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

Build failure due to GCC deprecation warnings

Saw this when installing via pip in a Travis.ci build. I was able to resolve it by setting the env variable CFLAGS="-Wno-error", but figured I'd post this as a reference for the warnings. Thanks!

Python 2.6.9
travis_time:finish:start=1406830035331541823,finish=1406830035366262833,duration=34721010
�[0Ktravis_time:start
�[0K$ pip --version
pip 1.5.4 from /home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages (python 2.6)
travis_time:finish:start=1406830035376107682,finish=1406830036488618693,duration=1112511011
�[0Ktravis_fold:start:install
�[0Ktravis_time:start
�[0K$ pip install -r requirements.txt
Downloading/unpacking umemcache==1.6.3 (from -r requirements.txt (line 1))
  Downloading umemcache-1.6.3.zip
  Running setup.py (path:/home/travis/virtualenv/python2.6.9/build/umemcache/setup.py) egg_info for package umemcache
Installing collected packages: umemcache
  Running setup.py install for umemcache
    building 'umemcache' extension
    gcc -pthread -fno-strict-aliasing -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWIN32_LEAN_AND_MEAN -I./lib/ -I/opt/python/2.6.9/include/python2.6 -c ./python/umemcache.cpp -o build/temp.linux-x86_64-2.6/./python/umemcache.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
    ./python/umemcache.cpp: In function ‘int Client_init(PyClient*, PyObject*, PyObject*)’:
    ./python/umemcache.cpp:255:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp:255:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp: In function ‘PyObject* Client_incr(PyClient*, PyObject*)’:
    ./python/umemcache.cpp:822:62: error: format not a string literal and no format arguments [-Werror=format-security]
    ./python/umemcache.cpp: In function ‘PyObject* Client_decr(PyClient*, PyObject*)’:
    ./python/umemcache.cpp:870:62: error: format not a string literal and no format arguments [-Werror=format-security]
    ./python/umemcache.cpp: At global scope:
    ./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    ./python/umemcache.cpp: In function ‘void initumemcache()’:
    ./python/umemcache.cpp:1124:31: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    cc1plus: some warnings being treated as errors
    error: command 'gcc' failed with exit status 1
    Complete output from command /home/travis/virtualenv/python2.6.9/bin/python -c "import setuptools, tokenize;__file__='/home/travis/virtualenv/python2.6.9/build/umemcache/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-IvrdDE-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/travis/virtualenv/python2.6.9/include/site/python2.6:
    running install

running build

running build_ext

building 'umemcache' extension

creating build

creating build/temp.linux-x86_64-2.6

creating build/temp.linux-x86_64-2.6/python

creating build/temp.linux-x86_64-2.6/lib

gcc -pthread -fno-strict-aliasing -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWIN32_LEAN_AND_MEAN -I./lib/ -I/opt/python/2.6.9/include/python2.6 -c ./python/umemcache.cpp -o build/temp.linux-x86_64-2.6/./python/umemcache.o

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]

./python/umemcache.cpp: In function ‘int Client_init(PyClient*, PyObject*, PyObject*)’:

./python/umemcache.cpp:255:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp:255:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp: In function ‘PyObject* Client_incr(PyClient*, PyObject*)’:

./python/umemcache.cpp:822:62: error: format not a string literal and no format arguments [-Werror=format-security]

./python/umemcache.cpp: In function ‘PyObject* Client_decr(PyClient*, PyObject*)’:

./python/umemcache.cpp:870:62: error: format not a string literal and no format arguments [-Werror=format-security]

./python/umemcache.cpp: At global scope:

./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp:1056:1: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

./python/umemcache.cpp: In function ‘void initumemcache()’:

./python/umemcache.cpp:1124:31: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

cc1plus: some warnings being treated as errors

error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
�[31mCommand /home/travis/virtualenv/python2.6.9/bin/python -c "import setuptools, tokenize;__file__='/home/travis/virtualenv/python2.6.9/build/umemcache/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-IvrdDE-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/travis/virtualenv/python2.6.9/include/site/python2.6 failed with error code 1 in /home/travis/virtualenv/python2.6.9/build/umemcache
�[0mTraceback (most recent call last):
  File "/home/travis/virtualenv/python2.6.9/bin/pip", line 11, in <module>
    sys.exit(main())
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)
travis_time:finish:start=1406830036508166748,finish=1406830040485105172,duration=3976938424
�[0K
�[31;1mThe command "pip install -r requirements.txt" failed and exited with 1 during .�[0m

Your build has been stopped.

A C++ client test implementation.

Is it possible to have a client test implementation like the one in python please ?
In the README or in the ./test/ directory.
Something like this... idk :

#include <iostream>
#include "../lib/Client.h"

int main(void)
{
    SOCKETDESC scktd;

    Client memcache_client(&scktd);

    if(memcache_client.connect("127.0.0.1", 11211))
    {
        std::cout << "[+] Success connection has been etablished with the memcached server !";
        //memcache_client.set("key","my value !");
    }
    else
    {
        std::cout << "[-] Error connection with memcached server !";
    }
    std::cout << "[-] Test !\n";

    return 0;
}

Please help !

Reconnect

How do I properly reconnect when the memcached server has been restarted?

I've tried closing the connection:
server.close()
server.disconnect()

but I always get the error:
umemcache: Connection reset by peer
Client can not be reconnected

when running server.connect()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.