Sockets
LookupService
perform internet service to port number translations
Calling Sequence
Parameters
Description
Examples
References
LookupService(portOrService, proto)
portOrService
-
string indicating a service name, or positive integer specifying a port number
proto
(optional) string; one of "tcp" or "udp"
A number of standard Internet services have assigned port numbers. The procedure LookupService enables you to map service names to port numbers, and vice versa.
The first argument portOrService specifies the service name (as a Maple string), or a port number for a reverse lookup (as a positive integer).
The second argument proto is optional. It must be entered as one of the two strings "tcp" or "udp". This argument specifies the protocol for the service. The default protocol is "tcp".
The "official" assignments of port numbers to services is specified in the Internet standard IANA Port Number Assignments, which is part of RFC 1700 Assigned Numbers. Be aware, however, that individual hosts may (and often do) reassign these port numbers, locally.
Note: If a service is not available, an error is returned.
withSockets:
LookupServicetelnet
23
LookupServiceftp
21
LookupServicesmtp
25
LookupServicesunrpc
111
LookupServicefinger
79
LookupServiceecho
7
LookupServiceecho,tcp
LookupServiceecho,udp
LookupServiceno such service
Error, (in Sockets:-LookupService) cannot determine port number for tcp service `no such service'
LookupService7
echo
Internet Assigned Numbers Authority, "IANA Port Number Assignments," IANA Home Page, http://www.iana.org/assignments/port-numbers; accessed 17 November 2005.
Information Sciences Institute, "RFC 1700 Assigned Numbers," ISI Home Page, http://www.isi.edu/in-notes/rfc1700.txt; accessed 17 November 2005.
See Also
Download Help Document