简体   繁体   English

python asyncore模块可以处理/连接多个套接字吗?

[英]Can python asyncore module handle/connect more than one socket?

I have a class that implements the asyncore module, it serves as a client that connects to HOST_A. 我有一个实现asyncore模块的类,它用作连接到HOST_A的客户端。 The problem is I need to pass the data received from HOST_A to a HOST_B. 问题是我需要将从HOST_A接收的数据传递到HOST_B。 So i'm wondering if asyncore can create two socket connections to HOST_A and HOST_B.Is this possible? 所以我想知道asyncore是否可以创建两个到HOST_A和HOST_B的套接字连接。这可能吗?

You can make one connection per socket at the same time only. 每个插座只能同时建立一个连接。 But this doesn't mean that you can't do what you want to, however you'll need 2 sockets for 2 connections. 但这并不意味着您无法做您想做的事,但是您需要2个套接字用于2个连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM