Project

General

Profile

On SOCKCLOSE » History » Version 2

Per Amundsen, 11/19/2015 09:53 AM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*<notextile>on <level>:SOCKCLOSE:name:<commands></notextile>*
4
5
Triggers when a connection is closed by the remote connection. (not by [[/sockclose]])
6
7
*Parameters*
8
9
<level> - The level for the event to trigger.
10
<name> - The [[$socketname]] to listen to.
11
<commands> - The commands to be performed when the event listener's criteria is met.
12
13 2 Per Amundsen
_See also [[on SOCKOPEN]], [[on SOCKLISTEN]], [[on SOCKREAD]], [[on SOCKWRITE]], [[/sockopen]], [[$sock]], [[$sockname]]._
14 1 Per Amundsen
15
*Example*
16
17
<pre>
18
; Open a connection to AdiIRC.com, port 80.
19
/sockopen adiirc adiirc.com 80
20
21
; Make a request for the index page.
22
on *:SOCKOPEN:adiirc:{
23
  sockwrite -n example1 GET / HTTP/1.0
24
  sockwrite -n example1 Host: www.adiirc.com
25
  sockwrite -n example1
26
}
27
28
on *:SOCKCLOSE:adiirc:echo -ag adiirc.com closed the connection
29
</pre>