mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,149
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,420
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,420
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.


Link Copied to Clipboard