diff --git a/hl7apy/mllp.py b/hl7apy/mllp.py index b386967..ad54da0 100644 --- a/hl7apy/mllp.py +++ b/hl7apy/mllp.py @@ -25,9 +25,9 @@ import re import socket try: - from SocketServer import StreamRequestHandler, TCPServer, ThreadingMixIn + from SocketServer import StreamRequestHandler, ThreadingTCPServer except ImportError: - from socketserver import StreamRequestHandler, TCPServer, ThreadingMixIn + from socketserver import StreamRequestHandler, ThreadingTCPServer from hl7apy.parser import get_message_type from hl7apy.exceptions import HL7apyException, ParserError @@ -139,7 +139,7 @@ def _create_error_handler(self, handler_class, exc, msg, args): return handler_class(exc, msg, *args) -class MLLPServer(ThreadingMixIn, TCPServer): +class MLLPServer(ThreadingTCPServer): """ A :class:`TCPServer ` subclass that implements an MLLP server. It receives MLLP-encoded HL7 and redirects them to the correct handler, according to the @@ -169,7 +169,7 @@ def __init__(self, host, port, handlers, timeout=10, request_handler_class=MLLPR self.port = port self.handlers = handlers self.timeout = timeout - TCPServer.__init__(self, (host, port), request_handler_class) + ThreadingTCPServer.__init__(self, (host, port), request_handler_class) class AbstractHandler(object):