Thanks for your bug report. This is by design. mIRC is reporting Winsock events as they happen. If an on SOCKCLOSE event is received by your script, that means this is what Winsock has reported. If an on SOCKWRITE event is received, again this means this is what Winsock has reported. As a scripter, you need to check each and every event for an error. If there is an error, you need to follow your own socket closing protocol for your script.