mIRC Homepage
Posted By: Wims /sockclose clientside, on sockclose/sockwrite - 08/07/19 09:56 PM
When i have a simple TCP server/client socket going on via /socklisten & /sockaccept, when the client use /sockclose to close the socket, on the server, most of the time it triggers on sockclose, which is expected to me, and I believe is how previous version of mIRC worked (I didn't check yet). But sometimes, on sockclose does not trigger, instead on sockwrite will trigger with $sockerr > 0 (tested on 7.56).

While I can understand this may be the way it works now (we can use on sockwrite, but I was kind of using /sockclose -> on sockclose as a logic for leaving the server), I was wondering if it could be something not intended?
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.
© mIRC Discussion Forums