/connect

Usage:

/CONNECT [-lq] [world]
/CONNECT host port


Attempts to open a socket connected to world. World must be defined by the /addworld command and not already connected. If world is omitted, the first defined world will be used. "/connect host port" will define a temporary world with the given address, and try to connect to it.

Options:

-l
No automatic login (i.e., don't call the LOGIN hook).
-q
Quiet login (overrides %{quiet} flag).
When successfully connected to a new socket, these events occur:

When a hostname is given, TF must resolve it to an IP address. If %{gethostbyname} is "nonblocking", and this process takes too long, TF will print "Hostname resolution for world in progress" (the PENDING hook) and continue to work in the background, leaving you free to do other things. If the resolution succeeds, TF will try to connect; if it fails, you will be notified.

On most platforms, if %{connect} is "nonblocking" and the connection takes too long, TF will print "Connection to world in progress" (the PENDING hook) and continue to try to connect in the background, leaving you free to do other things. If the connection eventually succeeds, you will be switched to that socket (but see note below); if it fails, you will be notified.

Even if %{gethostbyname} and/or %{connect} are "blocking", they can be interrupted with the SIGINT signal (^C).

When a pending /connect succeeds, the foregrounding is done by a CONNECT hook defined by the standard library. If you don't want to switch automaticly, you can either delete the default hook (/undef ~connect_switch_hook) or define your own (with a priority higher than 0). If you define your own but you still want the switch to occur, you must either make it a fall-thru, or explicitly call "/fg %1" from your hook.

If you have trouble connecting (especially if you use SOCKS), try setting connect=blocking.

/connect returns 0 on error or failure, 1 on success, or 2 if the connection is pending.

See: worlds, sockets, proxy, /world, /addworld, /fg, /retry, %login, %gethostbyname, %connect, hooks


Back to index
Back to tf home page
Copyright © 1995 - 1999 Ken Keys