30.09.2016, 10:15
Connection refused means that other socket end does not accept the connection. Single local UDP socket should not block anything, check your other scripts.
If you are using send() in resident script, you can change the code to close the socket after each send (this is done automatically when script ends, so it will work properly for event scripts with older code). Otherwise it might lead to "No file descriptors available" error when too many sockets are open (>1024).
If you are using send() in resident script, you can change the code to close the socket after each send (this is done automatically when script ends, so it will work properly for event scripts with older code). Otherwise it might lead to "No file descriptors available" error when too many sockets are open (>1024).
Code:
function send(cmd)
local sock = require('socket').udp()
if sock then
sock:sendto(cmd, '127.0.0.1', 5432)
sock:close()
end
end