Spaces:
Running
Running
Jeremiah Lowin Copilot commited on
Update src/fastmcp/utilities/http.py
Browse filesCo-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
src/fastmcp/utilities/http.py
CHANGED
|
@@ -3,6 +3,6 @@ import socket
|
|
| 3 |
|
| 4 |
def find_available_port() -> int:
|
| 5 |
"""Find an available port by letting the OS assign one."""
|
| 6 |
-
with socket.socket() as s:
|
| 7 |
s.bind(("127.0.0.1", 0))
|
| 8 |
return s.getsockname()[1]
|
|
|
|
| 3 |
|
| 4 |
def find_available_port() -> int:
|
| 5 |
"""Find an available port by letting the OS assign one."""
|
| 6 |
+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
| 7 |
s.bind(("127.0.0.1", 0))
|
| 8 |
return s.getsockname()[1]
|