Sockopen » History » Version 3
Per Amundsen, 05/25/2017 12:48 PM
| 1 | 1 | Per Amundsen | _Added in 1.8.10_ |
|---|---|---|---|
| 2 | |||
| 3 | 3 | Per Amundsen | */sockopen [-den46] [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 | 2 | Per Amundsen | -4 - Connect to Ipv4 addresses. |
| 11 | -6 - Connect to Ipv6 addresses. |
||
| 12 | 1 | Per Amundsen | |
| 13 | *Parameters* |
||
| 14 | |||
| 15 | [bindip] - Bind ip to be used. |
||
| 16 | <name> - Socket connection name. |
||
| 17 | <address> - Remote ip address to connect to. |
||
| 18 | <port> - Remote port to connect to. |
||
| 19 | |||
| 20 | *Example* |
||
| 21 | |||
| 22 | <pre> |
||
| 23 | alias example { |
||
| 24 | ;Initiate a connection with "irc.freenode.org" on port 6669, Secured connection. |
||
| 25 | /sockopen -e IRC irc.freenode.org +6697 |
||
| 26 | } |
||
| 27 | |||
| 28 | on *:sockopen:IRC:{ |
||
| 29 | ;Send our USER and NICK irc commands. |
||
| 30 | /sockwrite -n IRC USER Tester $+ $rand(1,100) Test Test:mSL Testing $+ $crlf |
||
| 31 | /sockwrite -n IRC NICK Tester $+ $rand(1,100) $crlf |
||
| 32 | } |
||
| 33 | |||
| 34 | ;Show all receiving data in a window. |
||
| 35 | on *:sockread:IRC:{ |
||
| 36 | /window -de @IRC |
||
| 37 | /var %x |
||
| 38 | /sockread %x |
||
| 39 | /aline -p @IRC $iif(%x,$v1,-) |
||
| 40 | } |
||
| 41 | </pre> |