F
F.G.Testa
Hi!
Is there a way to access a specific connected socket when using a derived
asyncore.dispatcher and derived asynchat.async_chat?
class AcmeServer(asyncore.dispatcher):
def __init__(self, port):
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.bind(("", port))
self.listen(5)
def handle_accept(self):
conn, addr = self.accept()
AcmeChannel(self, conn, addr)
def handle_close(self):
print 'Server closed'
def handle_error(self):
print 'Server error'
How do I access the underlying list/map/array of AcmeChannel?
Thank you.
Is there a way to access a specific connected socket when using a derived
asyncore.dispatcher and derived asynchat.async_chat?
class AcmeServer(asyncore.dispatcher):
def __init__(self, port):
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.bind(("", port))
self.listen(5)
def handle_accept(self):
conn, addr = self.accept()
AcmeChannel(self, conn, addr)
def handle_close(self):
print 'Server closed'
def handle_error(self):
print 'Server error'
How do I access the underlying list/map/array of AcmeChannel?
Thank you.