开发者

twisted three-layer server-client model?

开发者 https://www.devze.com 2023-01-07 04:54 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消