Apple Newton Internet Enabler Especificaciones Pagina 8

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 24
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 7
June 1996 Newton Technology Journal
8
the DNSGetMailServerNameFromDomainName
function translates a domain name into the domain name for a mail
server that serves that domain.
the DNSGetNameFromAddressfunction translates an
Internet address into its corresponding domain name.
You must supply a
clientContext
and
clientCallback
parameter to
each of the DNS functions, just as you do for the link controller functions.
However, the DNS callback functions are called with different parameters
than are the link controller functions.
The callback function for DNSCancelRequests receives no
parameters.
The callback function for all of the other DNS functions receives two
parameters: an array of DNS results frames and a result code. Each results
frame contains a number of slots that describe the DNS operation that was
performed. For example, the DNSGetAddressFromName
function is declared as follows:
DNSGetAddressFromName(addr, clientContext, clientCallback)
An example of a callback for this function is shown here:
myApp.DNSGetAddrcallback := func(results, error)
begin
if error or length(results) < 1 then
begin
print("DNS error: " && error);
// do something with the error
return;
end;
// save the resolved address
myRemoteIpAddr := results[0].resultIPAddress;
end;
Each results frame contains a type slot and at least one result slot. Most
results frames contain the
targetDomainName
slot; however, this is not
guaranteed. Table 1-2 shows which slot is guaranteed to be valid for each
DNS operation.
Table 1-2: Result slots for each DNS operation
DNS operation Results frame slot
DNSGetAddressFromName resultIPAddress
DNSGetNameFromAddress resultDomainName
DNSGetMailServerNameFromDomainName
resultDomainName
DNSGetMailAddressFromName resultIPAddress
For example, the DNSGetAddressFromName function
returns a results array that looks something like this:
[ {
type: kDNSAddressType,
targetDomainName: "newton.apple.com.",
resultIPAddress: [155,227,54,3]
} ]
In contrast, the DNSGetNameFromAddress function
returns a results array that looks something like this
[{
type: kDNSDomainNameType,
targetDomainName: "newton.apple.com.",
resultIPAddress: [155,227,54,3]
} ]
Some DNS operations return a results array that contains more than one
results frame. For example, a mail exchange operation can generate
multiple mail exchange results frames.
USING THE NEWTON INTERNET ENABLER OPTIONS
You configure the Newton Internet Enabler links with communications
options. Send these options down with your endpoint method calls, as
you do for other communications tools. Table 1-3 describes the Newton
Internet Enabler options, including which options to send with which
endpoint methods.
Table 1-3: Newton Internet Enabler options
Option name Description When to use
Expedited data For expedited Set this option with an
transfer
('iexp')
transmission of data Output call to
over a TCP link. transfer data on a TCP
endpoint.
Physical link To identify the link ID to use. Set this option at endpoint
identifier
('ilid')
instantiation time.
Local port To set the local port number Set this option if you are
('ilpt')
for TCP binds. binding to do a Listen
(at endpoint instantiation
or bind time). You don’t
need to set this option for
a Connect.
To set the local port number Set this option at endpoint
for UDP binds. instantiation or bind time.
To retrieve the local port Retrieve the value of this
number used for TCP option when you are
or UDP. connecting, sending, or
receiving data.
TCP remote socket To set the socket to which Set the value of this option
('itrs') TCP connects. at before using the
connection (at endpoint
instantiation, bind, or
connect time).
To retrieve the sender Get the value of this option
address for data received when listening for data on
over a TCP link. a TCP connection.
Transport service To set the transport Set this option at endpoint
type ('itsv') service type (TCP or UDP). instantiation time.
UDP destination To set the destination Set this option when
socket ('iuds') address for data being sending data with a UDP
sent over a UDP link. connection.
To retrieve the destination Get this option when
address for data received listening for data on a UDP
over a UDP link. connection.
UDP source socket To retrieve the source Get the value of this option
('iuss') address for data received when listening for data on
over a UDP link. a UDP connection.
NEWTON INTERNET ENABLER: PROVIDING CONVENIENT CONNECTIVITY
To summarize, the Newton Internet Enabler makes it easy for you to
provide Internet connectivity in your NewtonScript applications. If you
Vista de pagina 7
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 23 24

Comentarios a estos manuales

Sin comentarios