Esteve Fernandez wrote:
> if I understood it correctly, this would suffice:
> 
> class MyThriftServerFactory(ThriftServerFactory):
> 
>     def buildProtocol(self, addr):
>         p = self.protocol()
>         p.factory = self
> 
>         # add something to the protocol instance
>         # e.g. a unique id
>         import uuid
>         p.connection_id = uuid.uuid4()
> 
>         return p
> 
> then use MyThriftServerFactory as you'd normally use ThriftServerFactory

Hi Esteve,

It seems to be a half-working solution since I don't see how i can then access 
this data from the thrift handler (which is shared by all incoming client 
connexions).

For example, how could i access this protocol.connection_id from one of the 
thrift function handler of the MyHandler instance, in my previous example?

cheers,

-- 
Matthieu

Reply via email to