NAME(S)
CMAPP_GetMyHostName,
CMAPP_MakeServer,
CMApp_OpenHost,
CMApp_PurgeConnections,
CMApp_SetLocalHost,
CMApp_SourceFileInfo,
CMApp_RPC,
CMApp_RDO,
CMApp_TranslateURL,
CMApp_SplitURL,
CMApp_IsURL,
SYNOPSIS
CMAPP_GetMyHostName
CMAPP_MakeServer ?portNum?
CMApp_OpenHost <host> <port> ?checkCmd?
CMApp_PurgeConnections ?num?
CMApp_SetLocalHost <host> ?port?
CMApp_SourceFileInfo <tupple>
CMApp_RPC <host> <port> <args>
CMApp_RDO <host> <port> <args>
CMApp_TranslateURL <url> <args>
CMApp_SplitURL <url>
CMApp_IsURL <url>
DESCRIPTION
Author: Eric14@cs.berkeley.edu
Date: 02-27-95
Purpose: Generally useful network handling routines
CMAPP_GetMyHostName
Returns the name of the current host.
CMAPP_MakeServer ?portNum?
Makes the process a server. The server will attempt to
launch with the given port number if possible.
gCMAPP_MyPort is set to the resulting port. If a server has
already been opened, then return the existing port (if the
numbers match, else error).
CMApp_OpenHost <host> <port> ?checkCmd?
Opens a Tcl-DP pier connection to the given host and port.
The advantage of this over the standard dp_MakeRPCClient is
that the connection is cached and latter attempts to connect
to the same host:port recieve the same connection. Close
the returned connection with CMApp_CloseHost. This insures
that connections are properly referance counted and purged
only when no longer used.
Returns: file id of new client socket (just like
dp_MakeRPCClient).
CMApp_PurgeConnections ?num?
Removes some or all of the currently unused cached connec-
tions. The $num argument specifies the number of connec-
tions to purge. By default (ie no argument) all connections
are purged. The keyword all may also be used.
CMApp_SetLocalHost <host> ?port?
This function sets the location to use when attempting to
resolve local file referances. The keyword -SAME is used as
a host name if local file refferances should be resolved in
the same proccess.
CMApp_SourceFileInfo <tupple>
Examines the file specified in the tupple (returned from
CMApp_TranslateURL) and returns a list containing {type
duration}. If the file investigated is a script, then the
type returned is 'movie/cmt' and the duration is not valid.
For further details, see CMP_ExamineFile.
CMApp_RPC <host> <port> <args>
Takes a host port pair and executes a RPC on the refferanced
process. Assume that a connection is opened and closed
around the RPC, but connections are cached for efficiency.
CMApp_RDO <host> <port> <args>
Takes a host port pair and executes a RDO on the refferanced
process. Assume that a connection is opened and closed
around the RPC, but connections are cached for efficiency.
CMApp_TranslateURL <url> <args>
Resolves the URL into a {host port file}-tupple which points
to a CMS process. This resolution is done by contacting the
host:port in the URL and issuing a CMTP_Translate command.
This returns either another URL or the needed tupple. If an
URL is returned, then the process repeats.
CMApp_SplitURL <url>
Parses an URL into {protocol host port file} with {} filling
unspecifed slots.
Error: iff host spec is not correct.
CMApp_IsURL <url>
returns 1 iff url appears to be an URL, else 0.