Added fake player creation upon connection for the msg pipeline.

This commit is contained in:
ProfMobius committed 2014-10-02 00:19:36 +02:00
1 parent 6eb3e5880c
commit e127d4426a
3 files changed
+52 -3

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
import asyncore, socket
class ClientTest(asyncore.dispatcher):
def __init__(self, host, port):
asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.connect( (host, port) )
self.buffer = "Test"
def handle_connect(self):
print "handle_connect"
def handle_close(self):
print "handle_close"
self.close()
def handle_read(self):
print self.recv(8192)
def handle_write(self):
sent = self.send(self.buffer)
self.buffer = self.buffer[sent:]
def writable(self):
return (len(self.buffer) > 0)
client = ClientTest('localhost', 25566)
asyncore.loop()