thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gashero <harry.pyt...@gmail.com>
Subject Is anybody use twisted(Python) & thrift?
Date Fri, 12 Jun 2009 08:12:45 GMT
My project use thrift as RPC framework, it's work well. But I want it
work as a daemon process. And I'm familar with twisted.

But there is no example about thrift with twisted server. So I guess
that example maybe like this::

from twisted.internet import reactor,protocol
from twisted.application import service,internet
from twisted.python import log

from thrift.transport import TTwisted

def twisted_main():
    log.startLogging(sys.stdout)
    handler=yyplogic.YyPassportHandler()
    processor=YyPassport.Processor(handler)
    pfactory=TBinaryProtocol.TBinaryProtocolFactory()
    reactor.listenTCP(setting.PORT,TTwisted.ThriftServerFactory(processor,pfactory))
    reactor.suggestThreadPoolSize(50)
    reactor.run()
    return

But it doesn't work. I follow the source code, find that twisted code
use Int32StringReceiver, and receive data length header is biger than
the limit. So, the server cut down the connection. At this time, the
client will raise and TTransportException with argument "None".

Can anybody help me ?

Mime
View raw message