Add convenience method to close transports.If the client is created via thriftpy.rpc.make_client, there seems to be
no public way of closing the connection to the server. This adds a
public method to TClient to do exactly that.
another fix for compat issues.now only support ssl in python >= 2.7.9 or python >= 3.4
support ssl in older python is a headache, it's much complex than
a first glance, if you're serious about security, upgrade you
python to use modern ssl lib.
more info: https://www.python.org/downloads/release/python-279/
refine TScoket and TServerSocket implementationmore feature rich sockets based on java lib implementation:
1. able to config connect_timeout and socket_timeout
2. add default linger, keepalive, tcp_nodelay to socketopt
3. able to config client_timeout, backlog in serversocket
4. default to AF_INET ipv4 address (configurable to ipv6)
init() now directly stores a copy of locals().We always start with an empty __dict__, and the dict.copy() method appears to
be a bit faster than dict.update().
Also, 'self' always exists in locals() so we can just delete that key directly
(instead of calling dict.pop()).
Simplify the read_i08() bool result cast.The cython-generated code for `bool(read_i08(buf))` includes a call to the
Python `bool` type function. That extra call is unnecessary in this case.
Instead, we can cast to cython's `bint` type, which generates code that
directly returns `Py_True` or `Py_False` (via `__Pyx_PyBool_FromLong`).
This appears to be the most efficient code generation for this expression.
For completeness, I also inv...
Support integer boolean constants.Some Thrift generators used to produce bad code for some languages that used
'true' and 'false' as reserved keywords, so there are Thrift files in the wild
that use {0,1} to represent the {false,true} boolean constant values.
This is also supported by Apache Thrift.