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

Function runClient

tutorial/go/src/client.go:81–99  ·  view source on GitHub ↗
(transportFactory thrift.TTransportFactory, protocolFactory thrift.TProtocolFactory, addr string, secure bool, cfg *thrift.TConfiguration)

Source from the content-addressed store, hash-verified

79}
80
81func runClient(transportFactory thrift.TTransportFactory, protocolFactory thrift.TProtocolFactory, addr string, secure bool, cfg *thrift.TConfiguration) error {
82 var transport thrift.TTransport
83 if secure {
84 transport = thrift.NewTSSLSocketConf(addr, cfg)
85 } else {
86 transport = thrift.NewTSocketConf(addr, cfg)
87 }
88 transport, err := transportFactory.GetTransport(transport)
89 if err != nil {
90 return err
91 }
92 defer transport.Close()
93 if err := transport.Open(); err != nil {
94 return err
95 }
96 iprot := protocolFactory.GetProtocol(transport)
97 oprot := protocolFactory.GetProtocol(transport)
98 return handleClient(tutorial.NewCalculatorClient(thrift.NewTStandardClient(iprot, oprot)))
99}

Callers 1

mainFunction · 0.85

Calls 8

CloseMethod · 0.95
OpenMethod · 0.95
NewTSSLSocketConfFunction · 0.92
NewTSocketConfFunction · 0.92
NewTStandardClientFunction · 0.92
handleClientFunction · 0.85
GetTransportMethod · 0.65
GetProtocolMethod · 0.65

Tested by

no test coverage detected