allow multiple REPL at once by seeking free port before server set up

This commit is contained in:
Yuna Tomida 2022-08-27 11:27:30 +09:00
parent 6b7410100d
commit 9210188b71
No known key found for this signature in database
GPG key ID: E6EC40A47CA07A6F
2 changed files with 22 additions and 7 deletions

View file

@ -6,7 +6,8 @@ import importlib as __importlib
import io as __io
__server_socket = __socket.socket()
__server_socket.bind(('0.0.0.0', 8736))
# DummyVM will replace this __PORT__ with free port
__server_socket.bind(('127.0.0.1', __PORT__))
__server_socket.listen(1)
(__client_socket, __client_address) = __server_socket.accept()