Project

General

Profile

Sockopen » History » Version 9

Per Amundsen, 10/04/2020 06:43 PM

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