I have a bit of a problem, I hope you can give me some directions.
I have the following code:
Code: Select all
proc sendstart {nick host hand chan text} {
global server port
set s [ socket $server $port]
puts $s "$text"
flush $s
set line [gets $s]
putquick "PRIVMSG $chan :$line"
}
But the problem is this. If the other server I connect to is not available, or the service isn't returning anything, my bot times out and crashes. Is there a way to prevent this? I though of using a timer and check after 5 seconds, if there is no result, return with "Problem with service"
But I don't know how to do this
Anyone got some suggestions?
Thankx,
Chrizz