Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
cloudooo
Commits
ebeac211
Commit
ebeac211
authored
Apr 23, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ooo/util: close sockets in socketStatus
parent
a77f5599
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
cloudooo/handler/ooo/util.py
cloudooo/handler/ooo/util.py
+3
-1
No files found.
cloudooo/handler/ooo/util.py
View file @
ebeac211
...
...
@@ -28,6 +28,7 @@
#
##############################################################################
import
contextlib
from
socket
import
socket
,
error
from
errno
import
EADDRINUSE
from
time
import
sleep
...
...
@@ -47,7 +48,8 @@ def removeDirectory(path):
def
socketStatus
(
hostname
,
port
):
"""Verify if the address is busy."""
try
:
socket
().
bind
((
hostname
,
port
),)
with
contextlib
.
closing
(
socket
())
as
sock
:
sock
.
bind
((
hostname
,
port
))
# False if the is free
return
False
except
error
as
err
:
...
...
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