![]() | ![]() | ![]() | GSK Reference Manual | ![]() |
---|
This section of the tutorial describes how to write a client.
The first step in implementing a client is figuring out how to determine the host and port to connect to:
Is there a default host? If not, the host should either be determined programmatically (eg via an environment variable, a configuration file, a command-line parameter, or some other way), or the host may be a standard IP address or name. You may have to wait on DNS lookups; use the gsk_name_resolve function to lookup the name.
The port often defaults to a service-specific default port. Traditionally /etc/services gives a map from the port number to service name. More often, the default port is just hardcoded into the program.
<<< Writing a Generic Server | Writing an HTTP Server >>> |