Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
dfb13ac4
Unverified
Commit
dfb13ac4
authored
Mar 03, 2024
by
Liangsheng Yin
Committed by
GitHub
Mar 03, 2024
Browse files
Fix addr reuse in check_port (#253)
parent
ec90b9c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+1
-0
No files found.
python/sglang/srt/utils.py
View file @
dfb13ac4
...
@@ -103,6 +103,7 @@ def alloc_usable_network_port(num, used_list=()):
...
@@ -103,6 +103,7 @@ def alloc_usable_network_port(num, used_list=()):
def
check_port
(
port
):
def
check_port
(
port
):
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
as
s
:
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
as
s
:
try
:
try
:
s
.
setsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_REUSEADDR
,
1
)
s
.
bind
((
""
,
port
))
s
.
bind
((
""
,
port
))
return
True
return
True
except
socket
.
error
:
except
socket
.
error
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment