Project

General

Profile

Sockmark » History » Revision 2

Revision 1 (Per Amundsen, 02/15/2014 07:15 PM) → Revision 2/3 (Per Amundsen, 05/24/2018 10:14 AM)

_Added in 1.9.0_ 

 */sockmark <name> [text]* 

 Assigns temporary data to a socket to be referenced later using [[$sock]](<name>).mark. Leaving the [text] parameter $null will clear the socket mark. The sockmark command can be used to assign the same data to multiple sockets using a [[Scripting_Wildcards|wildcard]] wildcard pattern. 

 *Parameters* 

 &lt;name&gt; - Socket to mark. 
 [text] - Text to add to the socket mark. 

 *Example* 

 <pre> 
 ; Non-functioning example, shows practical usage only 
 on $*:text:/^!foo (\S+)$/Si:#:{ 
   ; if ( .. validate input .. ) { 
   sockopen sock1 www.example.com 80 
   sockmark sock1 $regml(1) 
 } 
 on *:sockopen:sock1:{ 
   ; submit the information we got from the user  
   sockwrite -nt $sockname GET /foobar.php?q= $+ sock($sockname).mark HTTP/1.0 
   sockwrite -nt $sockname Host: www.example.com 
   sockwrite -nt $sockname $crlf 
 } 
 ; on *:sockread:sock1: { 
 ;      .... 
 ; } 
 </pre>