Project

General

Profile

On SOCKREAD » History » Version 4

Per Amundsen, 02/24/2017 09:37 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*<notextile>on <level>:SOCKREAD:name:<commands></notextile>*
4
5
Triggers when there is info waiting to be read on the specified connection. 
6
You can read this info using the [[/sockread]] command.
7
8 2 Per Amundsen
_See also [[on SOCKOPEN]], [[on SOCKCLOSE]], [[on SOCKLISTEN]], [[on SOCKWRITE]], [[on UDPREAD]], [[/socklisten]], [[/sockopen]], [[/sockaccept]], [[$sock]], [[$sockbr]], [[$sockerr]], [[$sockname]]._
9 1 Per Amundsen
10
*Parameters*
11
12 4 Per Amundsen
<level> - The [[User Access Level]] for the event to trigger.
13 1 Per Amundsen
<name> - The [[$sockname]] to listen to.
14
<commands> - The commands to be performed when the event listener's criteria is met.
15
16
*Example*
17
18
<pre>
19
; Open a connection to AdiIRC.com, port 80.
20
/sockopen adiirc adiirc.com 80
21
22
; Make a request for the index page.
23
on *:SOCKOPEN:adiirc:{
24 3 Per Amundsen
  sockwrite -n adiirc GET / HTTP/1.0
25
  sockwrite -n adiirc Host: www.adiirc.com
26
  sockwrite -n adiirc 
27 1 Per Amundsen
}
28
29
on *:SOCKREAD:adiirc:{
30
  var %s
31
  sockread %s
32
  echo -ag Read line %s
33
}
34
</pre>