Sockopen » History » Version 6
Per Amundsen, 11/11/2019 11:02 AM
1 | 1 | Per Amundsen | _Added in 1.8.10_ |
---|---|---|---|
2 | |||
3 | 5 | Per Amundsen | */sockopen [-dent46] [bindip] <name> <address> <port>* |
4 | 1 | Per Amundsen | |
5 | *Switches* |
||
6 | |||
7 | -d - The specified IP address is the bind ip address. |
||
8 | -e - Creates an SSL connection. |
||
9 | 3 | Per Amundsen | -n - Disables the "Nagle algorithm":https://en.wikipedia.org/wiki/Nagle%27s_algorithm. |
10 | 4 | Per Amundsen | -t - TODO |
11 | 2 | Per Amundsen | -4 - Connect to Ipv4 addresses. |
12 | -6 - Connect to Ipv6 addresses. |
||
13 | 1 | Per Amundsen | |
14 | *Parameters* |
||
15 | |||
16 | [bindip] - Bind ip to be used. |
||
17 | <name> - Socket connection name. |
||
18 | <address> - Remote ip address to connect to. |
||
19 | <port> - Remote port to connect to. |
||
20 | |||
21 | *Example* |
||
22 | |||
23 | <pre> |
||
24 | alias example { |
||
25 | 6 | Per Amundsen | ; Initiate a connection with "irc.freenode.org" on port 6669, Secured connection. |
26 | 1 | Per Amundsen | /sockopen -e IRC irc.freenode.org +6697 |
27 | } |
||
28 | |||
29 | on *:sockopen:IRC:{ |
||
30 | 6 | Per Amundsen | ; Send our USER and NICK irc commands. |
31 | 1 | Per Amundsen | /sockwrite -n IRC USER Tester $+ $rand(1,100) Test Test:mSL Testing $+ $crlf |
32 | /sockwrite -n IRC NICK Tester $+ $rand(1,100) $crlf |
||
33 | } |
||
34 | |||
35 | 6 | Per Amundsen | ; Show all receiving data in a window. |
36 | 1 | Per Amundsen | on *:sockread:IRC:{ |
37 | /window -de @IRC |
||
38 | /var %x |
||
39 | /sockread %x |
||
40 | /aline -p @IRC $iif(%x,$v1,-) |
||
41 | } |
||
42 | </pre> |