twisted three-layer server-client model?
I'm trying to do a three-layer server-client:
1st layer: send data to 2nd layer
2nd layer: receive data from 1st and send it to 3rd
3rd layer: receive data from 2nd layer
By this way, 2nd 开发者_高级运维layer need to be implemented as both server and client, is that doable with twisted ?
This might be something close to what you're looking for. Or at least, it could probably implement layer 2 in your scheme. The 1st and 3rd layers would just be normal ServerProtocol/ClientProtocol. The middle has to essentially be a proxy between the two. As you can see in the example, an approach to this is attaching a clientfactory to the serverprotocol.
精彩评论