¿Cómo obtener la información del cliente en el servidor Python Thrift?

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

1 Respuestas

dos ideas:

  1. 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.

  2. 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.

respondido 10 mar '12, 22:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.