Sockets
HostInfo
retrieve platform specific host information
Calling Sequence
Parameters
Description
Examples
HostInfo( key::symbol )::anything
key
-
recognized symbol identifying the requested information
It is often necessary to retrieve platform specific data about the host on which your Sockets package code is running. The procedure HostInfo provides a simple interface through which you can request this kind of information.
A single symbol called the key is a required argument. The key is a mnemonic identifier for the specific information requested. An unrecognized key, or a call with a recognized key for which the information requested is not available results in an appropriate error message.
The recognized keys vary according to platform, but the following keys are recognized on all platforms: platform, os, hostname, domainname, and pid.
Platform specific keys generally exist only for testing purposes, are subject to change, and are not documented. For example, the key glibc is recognized only on Linux platforms (and reflects the compile-time glibc library version number.
with⁡Sockets:
HostInfo⁡platform
unix
HostInfo⁡os
Linux
HostInfo⁡pid
31724
HostInfo⁡domainname
(none)
If an unrecognized key is used, Maple returns an error.
HostInfo⁡NoSuchKey
Error, (in Sockets:-HostInfo) HostInfo request not recognised
If a key is not relevant in a platform, for example, domainname in a single user Windows version, Maple returns an error.
Error, (in Sockets:-HostInfo) unable to determine host information
See Also
Sockets,GetHostName
Sockets,GetProcessID
Download Help Document