From: Eric S. Raymond Date: Sun, 26 Aug 2012 17:54:16 +0000 (-0400) Subject: Use StreamRequestHandler. X-Git-Tag: 1.0~112 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b0fa0aaa0ad3d99dedb4fba47625b183dbec378b;p=irker.git Use StreamRequestHandler. --- diff --git a/irker.py b/irker.py index 12e1da3..450b738 100755 --- a/irker.py +++ b/irker.py @@ -126,10 +126,9 @@ class Irker: for session in self.sessions.values(): session.await() -class MyTCPHandler(SocketServer.BaseRequestHandler): +class MyTCPHandler(SocketServer.StreamRequestHandler): def handle(self): - # self.request is the TCP socket connected to the client - irker.handle(self.request.recv(1024).strip()) + irker.handle(self.rfile.readline().strip()) if __name__ == '__main__': host = HOST