on sockclose
Indice
The ON SOCKCLOSE event triggers when a TCP socket connection is closed by the remote host.
| Contents - 1 Synopsis - 2 Parameters - 3 Connection State - 4 Example - 5 Compatibility - 6 See Also |
Synopsis
ON <level>:SOCKCLOSE:<name>:<commands>
Parameters
**
**
**
Connection State
The reason a socket is closed could be because of an error, rather than because the remote host closed your connection on purpose, you should check $sockerr”) for error, here is a list of the possible value for $sockerr inside the on sockclose event:
- 0 - EOF from the remote host received, this actually means the remote host closed your connection successfuly.
- 3 - An error occurred while receiving data, or a SSL error occurred, $sock().wsmsg will contain a more specific error message.
- 5 - An SSL error of some kind occurred when trying to initialize the connection. Unlikely to happen. If you get this you most likely are trying to initiate an SSL socket connection without SSL capabilities (check {mIRC|$sslready}}, which is $false if you don’t have them)
Example
When the socket closes, echo that the socket has closed and some details about it to the active window:
ON *:SOCKCLOSE:*: {
echo -a ::=> $sockname Connection to $sock($sockname).ip on port $sock($sockname).port closed by the remote host!
}
Compatibility
Added: mIRC v6.14
Added on: 03/03/2004
Note: Individual switches were not taken into consideration.
See Also
- on sockopen
- on sockread
- on sockwrite
- on socklisten
- /sockaccept
- /socklist
- /sockmark
- /sockopen
- /sockpause
- /sockread
- /sockrename
- /sockudp
- /sockwrite
- $sock”)
mIRC on event list
| A on Action, on Active, on Agent”), on Appactive B on Ban C on Chat, on Chatclose”), on Chatopen”), on Close, on Connect, on Connectfail, on Ctcpreply D on Dccserver, on Dehelp, on Deop, on Deowner, on Devoice, on Dialog, on Disconnect, on Dns E on Error, on Exit F on Filercvd, on Filesent G on Getfail | H on Help, on Hotlink I on Input, on Invite J on Join K on Keydown, on Keyup, on Kick L on Load, on Logon M on Me”), on Midiend, on Mode, on Mp3end N on Nick, on Nosound, on Notice, on Notify O on Op, on Open, on Owner P on Part, on Ping, on Playend, on Pong | Q on Queryclose”), on Queryopen”), on Quit R on Rawmode S on Sendfail, on Serv, on Servclose”), on Servermode, on Serverop, on Servopen”), on Signal”), on Snotice, on Sockclose”), on Socklisten, on Sockopen, on Sockread, on Sockwrite, on Start T on Text, on Topic U on Udpread, on Udpwrite, on Unban, on Unload, on Unotify, on Usermode | V on Vcmd, on Voice W on Wallops, on Waveend |