Skip to content

Commit

Permalink
Merge pull request #69 from sloria/threading-tcp-server
Browse files Browse the repository at this point in the history
Use ThreadingTCPServer
  • Loading branch information
svituz authored Jan 24, 2020
2 parents d36236b + 3ab1716 commit 6900994
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hl7apy/mllp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <SocketServer.TCPServer>` subclass that implements an MLLP server.
It receives MLLP-encoded HL7 and redirects them to the correct handler, according to the
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 6900994

Please sign in to comment.