I have python Thrift server which is using TThreadPoolServer. My question is to how to get the client information in one of the server service routine? One way is to passed the client info while invoking the service from the client side (i.e. one of the arguments). Is there any other approach or API to do this?
preguntado el 09 de marzo de 12 a las 14:03
you can do it with some ugly stack tricks - going up one or two levels and starting to poke around for the socket. but the handler functions don't have access to this info.
you can create your own server that sets some context that can be accessed by the handlers, by deriving the server you are using and adding some API to do that. Maybe index the connection by thread id.