sock:bind() failure invalidates the socket's file descriptor

This commit is contained in:
jluehrs2 2007-09-04 18:20:01 -05:00
parent 34b1f0bfd0
commit b37239c2f9

View File

@ -151,8 +151,9 @@ end
-- above)
function send(nick, filename, port)
port = port or FIRST_PORT
local sock = base.assert(socket.tcp())
local sock
repeat
sock = base.assert(socket.tcp())
err, msg = sock:bind('*', port)
port = port + 1
until msg ~= "address already in use" and port <= LAST_PORT + 1