我正在建立一個TCP/IP協議的套接字,並且由於我的接收器正在處理int8u_t我想知道這種方法是否正確。 在連接服務器有一個值mode=int(42)發送到在def connectionMade(self)完成的接收器。但我知道會有一些衝突,因爲在Python中的正常int是32位,我的接收器只有8位,我可以以某種方式投它或在int8u創建它? from twisted.internet.pro
我寫了一個簡單的扭曲的服務器 - from twisted.internet import reactor
from twisted.internet import protocol
from twisted.web import server, resource
from twisted.internet import reactor
class Index(resource.Reso
我試圖計算的扭曲活動協議的數量,但我得到了一個錯誤: exceptions.AttributeError: Factory instance has no attribute 'numProtocols'
下面是代碼: class EchoPro(Protocol):
def connectionMade(self):
self.factory.numProtocols