From 10bb62a60a19570bb401dffcbe1e40912d04a0a5 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005287564 Date: Tue, 6 Aug 2024 14:32:37 -0700 Subject: [PATCH] removing dead targets] fbcode//idb/common/TARGETS Reviewed By: jbardini Differential Revision: D60816353 fbshipit-source-id: 439c3020022a2b1c7afb7d9223e5d4d1b9848ae0 --- idb/common/socket.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 idb/common/socket.py diff --git a/idb/common/socket.py b/idb/common/socket.py deleted file mode 100644 index 58948b34d..000000000 --- a/idb/common/socket.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -# pyre-strict - -from socket import AddressFamily, AF_INET, AF_INET6, socket -from typing import List, Optional, Tuple - - -def port_from_sockets(sockets: List[socket], family: AddressFamily) -> Optional[int]: - for sock in sockets: - if sock.family == family: - return sock.getsockname()[1] - return None - - -def ports_from_sockets(sockets: List[socket]) -> Tuple[Optional[int], Optional[int]]: - return (port_from_sockets(sockets, AF_INET), port_from_sockets(sockets, AF_INET6))