LookupService - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Sockets

  

LookupService

  

perform internet service to port number translations

 

Calling Sequence

Parameters

Description

Examples

References

Calling Sequence

LookupService(portOrService, proto)

Parameters

portOrService

-

string indicating a service name, or positive integer specifying a port number

proto

-

(optional) string; one of "tcp" or "udp"

Description

• 

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.

Examples

Note: If a service is not available, an error is returned.

withSockets:

LookupServicetelnet

23

(1)

LookupServiceftp

21

(2)

LookupServicesmtp

25

(3)

LookupServicesunrpc

111

(4)

LookupServicefinger

79

(5)

LookupServiceecho

7

(6)

LookupServiceecho,tcp

7

(7)

LookupServiceecho,udp

7

(8)

LookupServiceno such service

Error, (in Sockets:-LookupService) cannot determine port number for tcp service `no such service'

LookupService7

echo

(9)

References

  

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

Sockets