扭曲的三层服务器-客户端模型?
我正在尝试做一个三层服务器-客户端:
第一层:将数据发送到第二层
第二层:从第一层接收数据并将其发送到第三层
第三层:从第二层接收数据
这样,第二层需要既可以作为服务器又可以作为客户端实现,这可以用twisted吗?
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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个 可能与您正在寻找的东西很接近。或者至少,它可能可以在您的方案中实现第 2 层。第一层和第三层只是普通的服务器协议/客户端协议。中间人本质上必须是两者之间的代理。正如您在示例中看到的,实现此目的的一种方法是将 clientfactory 附加到服务器协议。
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.