Posted 16 December 2014 - 11:38 PM
I'm making a fairly simple modem API. One of the things is uses is callback functions for replies, like so:
Everything works fine, but I'm sure about what the lowest reasonable timeout is. The shorter the better really, although I don't want to miss messages. The reply is sent immediately (based on the return value), so it's not like there's a massive delay involved.
So yea, simply put how low can I reasonably set this timeout?
From experiments with os.time and os.clock I get a response virtually instantly, the time/clock value doesn't change. Although that's on SP.
-- computer 1
communicate:SendMessage('ping', 'Ping!', function(message)
print(message.content) -- Pong!
end)
-- computer 2
communicate:RegisterMessageType('ping', function(message)
return 'Pong!'
end)
Everything works fine, but I'm sure about what the lowest reasonable timeout is. The shorter the better really, although I don't want to miss messages. The reply is sent immediately (based on the return value), so it's not like there's a massive delay involved.
So yea, simply put how low can I reasonably set this timeout?
From experiments with os.time and os.clock I get a response virtually instantly, the time/clock value doesn't change. Although that's on SP.
Edited on 16 December 2014 - 10:59 PM