socket: limit getaddrinfo to TCP connections

This commit is contained in:
nemunaire 2017-07-17 07:53:36 +02:00
parent bbfecdfced
commit f633a3effe

View File

@ -81,7 +81,7 @@ class _Socket(AbstractServer):
class _SocketServer(_Socket):
def __init__(self, host, port, bind=None, **kwargs):
(family, type, proto, canonname, sockaddr) = socket.getaddrinfo(host, port)[0]
(family, type, proto, canonname, sockaddr) = socket.getaddrinfo(host, port, proto=socket.IPPROTO_TCP)[0]
super().__init__(family=family, type=type, proto=proto, **kwargs)