Sockmark » History » Version 1
Per Amundsen, 02/15/2014 07:15 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | */sockmark <name> [text]* |
||
4 | |||
5 | 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 wildcard pattern. |
||
6 | |||
7 | *Parameters* |
||
8 | |||
9 | <name> - Socket to mark. |
||
10 | [text] - Text to add to the socket mark. |
||
11 | |||
12 | *Example* |
||
13 | |||
14 | <pre> |
||
15 | ; Non-functioning example, shows practical usage only |
||
16 | on $*:text:/^!foo (\S+)$/Si:#:{ |
||
17 | ; if ( .. validate input .. ) { |
||
18 | sockopen sock1 www.example.com 80 |
||
19 | sockmark sock1 $regml(1) |
||
20 | } |
||
21 | on *:sockopen:sock1:{ |
||
22 | ; submit the information we got from the user |
||
23 | sockwrite -nt $sockname GET /foobar.php?q= $+ sock($sockname).mark HTTP/1.0 |
||
24 | sockwrite -nt $sockname Host: www.example.com |
||
25 | sockwrite -nt $sockname $crlf |
||
26 | } |
||
27 | ; on *:sockread:sock1: { |
||
28 | ; .... |
||
29 | ; } |
||
30 | </pre> |