jemnotesversion 2 / featuring this entry or see all/search

Dec 6
Here’s how to open a server at the next available port, then retrieve the port number:
server = TCPServer.new '127.0.0.1', 0
port = server.addr[1]