Apple Newton Utilities Guía de usuario Pagina 843

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 942
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 842
CHAPTER 23
Endpoint Interface
Using the Endpoint Interface 23-15
termination sequence, or an array of items, any one of which will cause the input to
terminate. A termination sequence can be a single character, a string, a number, or
an array of bytes. If you don't want to look for a termination sequence, don't dene
this slot.
For the
'binary data form, you cannot use the endSequence slot to specify a
termination condition.
Note
Note that the system executes byte-by-byte comparisons between
the termination sequence and the input stream. To facilitate this
process, the termination sequence (or elements within the
endSequence array) is converted to a byte or binary format to
speed the comparison. Internally, single characters are converted
to single bytes using the translation table specied by the
endpoint
encoding slot. Numbers are converted to single bytes;
strings are converted to binary objects. An array of bytes is also
treated as a binary object. For large numbers, you must encode
your number as an array of bytes if there are signicant digits
beyond the high order byte of the number.
If you want to terminate input based on a transport-level end-of-packet (EOP)
indicator, then you can set the
useEOP slot in the termination frame. This slot
holds a Boolean value specifying whether or not to look for EOP indicators.
Specify this slot only if the input spec
rcvFlags slot includes the kPacket ag.
Moreover, if the
rcvFlags slot includes the kPacket ag and you do not specify
the
termination.useEOP slot, the system effectively sets useEOP to the
default value
true. For more information, see the following section, “Specifying
Flags for Receiving.
It is not appropriate to specify the
termination slot for data forms other than
'string, 'bytes, and 'binary. The 'char and 'number data forms
automatically terminate after 1 and 4 bytes, respectively. The
'frame data form is
terminated automatically when a complete frame has been received, and the
'template data form terminates when the number of bytes received matches the
typelist specification in the target frame.
To limit the amount of accumulated data in the input buffer, you can dene a
discardAfter slot in the input spec. You can do this only when you have not
specied a
termination.byteCount slot for 'string and 'bytes data
forms. The
discardAfter slot sets the input buffer size. If the buffer overows,
older bytes are discarded in favor of more recently received bytes.
Vista de pagina 842
1 2 ... 838 839 840 841 842 843 844 845 846 847 848 ... 941 942

Comentarios a estos manuales

Sin comentarios