When opening two udp sockets in the same scope, mirc select the same local port if we don't use one :
mIRC is not actually re-using the same local port. The problem is that $sock().sport returns "the source ... port of the
last received UDP packet". The event "ON UDPREAD" doesn't get an opportunity to execute until after both /sockudp commands have been issued. By the time the event does execute (in response to the first UDP packet), the last received UDP packet is already the
second one. Unfortunately, this is a limitation of the way mIRC handles sockets. If you don't process the UDP packet before another UDP packet is received, you will lose the information about the UDP packets prior to the most recently received.