Establishes a network connection to the place specified by the arguments and more-or-less pretends that a new, normal player connection has been established from there. The new connection, as usual, will not be logged in initially and will have a negative object number associated with it for use with `read()', `notify()', and `boot_player()'. This object number is the value returned by this function.
If the programmer is not a wizard or if the `OUTBOUND_NETWORK' compilation option was not used in building the server, then `E_PERM' is raised.
<Host> refers to a string naming a host (possibly a numeric IP address) and <port> is an integer referring to a TCP port number. If a connection cannot be made because the host does not exist, the port does not exist, the host is not reachable or refused the connection, `E_INVARG' is raised. If the connection cannot be made for other reasons, including resource limitations, then `E_QUOTA' is raised.
Optionally, you can specify a map with any or all of the following options:
listener: An object whose listening verbs will be called at appropriate points. (See HELP LISTEN() for more details.)
tls: If true, establish a secure TLS connection.
ipv6: If true, utilize the IPv6 protocol rather than the IPv4 protocol.
The outbound connection process involves certain steps that can take quite a long time, during which the server is not doing anything else, including responding to user commands and executing MOO tasks. See the chapter on server assumptions about the database for details about how the server limits the amount of time it will wait for these steps to successfully complete.
It is worth mentioning one tricky point concerning the use of this function. Since the server treats the new connection pretty much like any normal player connection, it will naturally try to parse any input from that connection as commands in the usual way. To prevent this treatment, you should use `set_connection_option()' to set the `hold-input' option true on the connection.
Example:
>;open_network_connection("2607:5300:60:4be0::", 1234, ["ipv6" -> 1, "listener" -> #6, "tls" -> 1])
Open a new connection to the IPv6 address 2607:5300:60:4be0:: on port 1234 using TLS. Relevant verbs will be called on #6.