Project

General

Profile

On SOCKREAD » History » Version 2

Per Amundsen, 02/10/2016 01: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
<level> - The level for the event to trigger.
13
<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
  sockwrite -n example1 GET / HTTP/1.0
25
  sockwrite -n example1 Host: www.adiirc.com
26
  sockwrite -n example1
27
}
28
29
on *:SOCKREAD:adiirc:{
30
  var %s
31
  sockread %s
32
  echo -ag Read line %s
33
}
34
</pre>