mIRC Homepage
Say you had a script with a looping(0-0) timer that constanty activates at no delay. Also within this script is a sockread event that's for a socket continually listening to data.

Say while you finish processing the part of the script tied to the sockread event, more information is dropped off at the socket. Is it possible for the sockread to read twice or more in a row without the timer activating at least once? I don't really have a good means to test this and this would effectively jam-up the script if someone was flooding the socket with information.
Since mIRC scripting is single threaded, I would think that the execution of a 0 second timer set at 0 (infinite) repetitions would lock up your script, and mIRC, since no other process could be started in the delay the timer runs at.

Thus said, if the sockread in your script was coded after the timer, then the socket would not be read.

On the other hand, if it was coded before the timer, it would be read once, but not afterwards.

I do not recommend using a (0-0) timer, and in fact, I can't think of any reason for having a timer running that quickly.

If you need a fast timer, then try a millisecond timer and set it for 5 milliseconds. In my opinion, you probably wouldn't notice any difference.
A 0 0-timer won't freeze mIRC or the script.
Code:
//.timerinfinite 0 0 noop | timerbla 1 3 echo -a bla $(|,0) .timer 1 1 timerinfinite off

I second the scepticism bout the need for that a timer though smile

@silimon: If you really need the infinite timer, can't you stop it on sockread and restart it after $sockbr turned $null, or having received a specific chunk of data / specific ammount of bytes, or the like?
Or drop the timer altogether and have an alias call the socket event... then on sockclose, run the alias to open the socket again. It will loop as fast as possible that way without any need for timers and guarantees you avoid issues with the socket already being open or not finished reading the data.

That said, I'm sure there is a better way of handling the script. It probably doesn't need that non-stop reading of the socket. Checking every few seconds is probably good enough.
© mIRC Discussion Forums