Project

General

Profile

On SOCKREAD » History » Revision 2

Revision 1 (Per Amundsen, 11/19/2015 10:54 AM) → Revision 2/4 (Per Amundsen, 02/10/2016 01:37 PM)

_Added in 1.9.0_ 

 *<notextile>on <level>:SOCKREAD:name:<commands></notextile>* 

 Triggers when there is info waiting to be read on the specified connection.  
 You can read this info using the [[/sockread]] command. 

 _See also [[on SOCKOPEN]], [[on SOCKCLOSE]], [[on SOCKLISTEN]], [[on SOCKWRITE]], [[on UDPREAD]], [[/socklisten]], [[/sockopen]], [[/sockaccept]], [[$sock]], [[$sockbr]], [[$sockerr]], [[$sockname]]._ 

 *Parameters* 

 <level> - The level for the event to trigger. 
 <name> - The [[$sockname]] to listen to. 
 <commands> - The commands to be performed when the event listener's criteria is met. 

 *Example* 

 <pre> 
 ; Open a connection to AdiIRC.com, port 80. 
 /sockopen adiirc adiirc.com 80 

 ; Make a request for the index page. 
 on *:SOCKOPEN:adiirc:{ 
   sockwrite -n example1 GET / HTTP/1.0 
   sockwrite -n example1 Host: www.adiirc.com 
   sockwrite -n example1 
 } 

 on *:SOCKREAD:adiirc:{ 
   var %s 
   sockread %s 
   echo -ag Read line %s 
 } 
 </pre>