MCPcopy Create free account
hub / github.com/apache/thrift / init_protocol

Function init_protocol

test/features/util.py:46–59  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

44
45
46def init_protocol(args):
47 sock = TSocket(args.host, args.port, socket_family=socket.AF_INET)
48 sock.setTimeout(500)
49 trans = {
50 'buffered': TBufferedTransport,
51 'framed': TFramedTransport,
52 'http': THttpClient,
53 }[args.transport](sock)
54 trans.open()
55 return {
56 'binary': TBinaryProtocol,
57 'compact': TCompactProtocol,
58 'json': TJSONProtocol,
59 }[args.protocol](trans)

Callers 2

mainFunction · 0.90
mainFunction · 0.90

Calls 3

setTimeoutMethod · 0.95
TSocketClass · 0.90
openMethod · 0.45

Tested by

no test coverage detected