From b0fa0aaa0ad3d99dedb4fba47625b183dbec378b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 26 Aug 2012 13:54:16 -0400 Subject: [PATCH] Use StreamRequestHandler. --- irker.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 -- 2.26.2