зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1824708 - Call setsockopt before bind, r=gbrown
`setsockopt` should be called before `bind` to make sure the port can be quickly reused later. Differential Revision: https://phabricator.services.mozilla.com/D181253
This commit is contained in:
Родитель
44c2bd2a83
Коммит
f144cb3535
|
@ -2230,8 +2230,8 @@ toolbar#nav-bar {
|
|||
|
||||
def findFreePort(self, type):
|
||||
with closing(socket.socket(socket.AF_INET, type)) as s:
|
||||
s.bind(("127.0.0.1", 0))
|
||||
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
s.bind(("127.0.0.1", 0))
|
||||
return s.getsockname()[1]
|
||||
|
||||
def proxy(self, options):
|
||||
|
|
Загрузка…
Ссылка в новой задаче