mIRC Home    About    Download    Register    News    Help

Print Thread
/sockclose clientside, on sockclose/sockwrite #265724 08/07/19 09:56 PM
Joined: Jul 2006
Posts: 3,576
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,576
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?


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /sockclose clientside, on sockclose/sockwrite [Re: Wims] #265729 09/07/19 09:09 AM
Joined: Dec 2002
Posts: 4,565
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,565
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.