Show More
@@ -153,13 +153,9 b' class HttpHooksCallbackDaemon(ThreadedHo' | |||
|
153 | 153 | # request and wastes cpu at all other times. |
|
154 | 154 | POLL_INTERVAL = 0.01 |
|
155 | 155 | |
|
156 | def get_available_port(): | |
|
157 | family = socket.AF_INET | |
|
158 | socktype = socket.SOCK_STREAM | |
|
159 | host = '127.0.0.1' | |
|
160 | ||
|
161 | mysocket = socket.socket(family, socktype) | |
|
162 | mysocket.bind((host, 0)) | |
|
156 | def get_available_port(self): | |
|
157 | mysocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
|
158 | mysocket.bind(('127.0.0.1', 0)) | |
|
163 | 159 | port = mysocket.getsockname()[1] |
|
164 | 160 | mysocket.close() |
|
165 | 161 | del mysocket |
General Comments 0
You need to be logged in to leave comments.
Login now