mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-10-28 13:20:31 +08:00
added auto port find
This commit is contained in:
1 parent
01c0d9a2d4
commit
4b2096d2c6
1 file changed
+10
@@ -0,0 +1,10 @@
|
||||
import socket
|
||||
|
||||
s = socket.socket()
|
||||
host = socket.gethostname() # Get local machine name
|
||||
port = 12910 # Reserve a port for your service.
|
||||
s.bind((host, port)) # Bind to the port
|
||||
|
||||
s.listen(5) # Now wait for client connection.
|
||||
while True:
|
||||
c, addr = s.accept() # Establish connection with client.
|
||||
Reference in new issue
Block a user