Hi there,
I'm on ubuntu, thrift 0.13.0 and go 1.14.6.

I'm trying to convert my C++ thrift server in GO.
I cannot understand how to use the "context" (I guess I should use it) in
my service handler to get the ::apache::thrift::TConnectionInfo.
I mean that in c++, I can pass to the processor factory, my "handler
factory" which provides the getHandler method that is used by the
underlying Processor to pass the TConnectionInfo to my Handler and I'm
looking for something similar in the Thrift GO API.

The reason why I need to get the TConnectionInfo object (or similar data)
is that my handler uses it to connect back to the client that in turn
implements another service where it can receive callbacks, I mean oneway
in-band APIs.

In simple_server.go I see that the processRequests function fills the
context (associated to the client connection) by using:
- ctx = AddReadTHeaderToContext(defaultCtx, headerProtocol.GetReadHeaders())
- ctx = SetWriteHeaderList(ctx, p.forwardHeaders)
Anyway I don't get what is added and consequently how I can get the
information I need.

I am a newbie in GO and I hope that some expert in golang can help me.

Thanks!
BR, Paolo

Reply via email to