/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.

Nonblocking connect, on most platforms: If 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.

The value of %connect determines whether tf will try blocking or nonblocking connect. If you are getting "Resource tempoarily unavailable" problems when connecting, try setting connect=blocking.

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 (/unhook CONNECT) 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.

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

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


Back to index
Back to tf home page
Copyright © 1995, 1996, 1997 Ken Keys