develop
Sven Slootweg 12 years ago
parent ff03fe95e3
commit 84fc002684

@ -31,7 +31,12 @@ class Reactor:
for stream in writable: for stream in writable:
fileno = stream.fileno() fileno = stream.fileno()
obj = self.objmap[fileno]
try:
obj = self.objmap[fileno]
except KeyError, e:
# The client has disconnected. Skip to the next stream.
continue
if obj.objtype == "client": if obj.objtype == "client":
obj._write_cycle() obj._write_cycle()

@ -1,7 +1,7 @@
import pyreactor, time import pyreactor, time
from testclient import TestClient from testclient import TestClient
c = TestClient(host="127.0.0.1", port=4006) c = TestClient(host="kerpia.cryto.net", port=4006)
c.send({"test": "just sending some test data...", "number": 41, "file": open("testdata.dat", "rb")}) c.send({"test": "just sending some test data...", "number": 41, "file": open("testdata.dat", "rb")})

@ -1,7 +1,7 @@
import pyreactor, time import pyreactor, time
from testclient import TestClient from testclient import TestClient
s = pyreactor.Server("127.0.0.1", 4006, TestClient) s = pyreactor.Server("0.0.0.0", 4006, TestClient)
reactor = pyreactor.Reactor() reactor = pyreactor.Reactor()
reactor.add(s) reactor.add(s)

Loading…
Cancel
Save