2 # -*- coding: utf-8 -*-
5 sys
.path
.insert(0, "..")
7 from Systematiki
.Net
.GObjectProtocol
import *
8 from Systematiki
.Net
.BlockingProtocol
import _dbg
as deco
12 def unknown(*a
, **kw
):
18 p
.listen(("localhost", 5000))
22 def add_in_watch(sock2
):
23 gobject
.io_add_watch(sock2
, gobject
.IO_IN
, data_ready
)
26 def data_ready(sock2
, cond
):
27 data
= sock2
.recv(BUFLEN
)
30 # sock2.close() # This leads to 99% CPU usage!
42 mainloop
= gobject
.MainLoop()
56 if __name__
== "__main__":
58 sys
.exit(main(sys
.argv
))