When using sockudp -k to keep the connection opened (for a client), at some point the local port used (chosen randomly by mirc) sometimes change, which is a bug imo.
It doesn't happen very often and I never reproduced it myself locally, but I could reproduce it almost every time with different people using:
sockread -n &a
tokenize 32 $bvar(&a,1-96).text
echo -s $+($sock(socktest).saddr,:,$sock(socktest).sport) - $1-
/sockudp -k socktest N 127.0.0.1 N
to start listening for packet where N is any valid port (same number for the two here)
Then, start sending some data (not specifying the local port used):
/timer -ho 3000 0 sockudp -kn socktest1 IP N This is a test
(N is the one used above)
Once the timer is done, wait like 15 seconds and runs it again (might need to do that more than twice) and if the bug occurs, $sock(socktest).sport will be different when running the timer again.
Tested under mIRC 7.19 on win7