Important: The information in this document is obsolete and should not be used for new development.
dspRead
ThedspRead
routine reads data from a connection end's receive queue and writes the data to a buffer that you specify. You use thePBControl
function to call thedspRead
routine. See "Routines" on page 5-43 for a description of thePBControl
function.
--> ioCompletion ProcPtr A pointer to a completion routine. <-- ioResult OSErr The function result. --> ioCRefNum Integer The driver reference number. --> csCode Integer Always dspRead
for this function.--> ccbRefNum Integer The CCB reference number. --> reqCount Integer The requested number of bytes. <-- actCount Integer The actual number of bytes read. --> dataPtr Ptr A pointer to the data buffer. <-- eom Byte A flag indicating the end of message.
Field Description
csCode
- The routine selector, always
dspRead
for this routine.ccbRefNum
- The connection control block (CCB) reference number that the
dspInit
routine returned.reqCount
- The number of bytes that ADSP is to read.
actCount
- The actual number of bytes that ADSP read.
dataPtr
- A pointer to the buffer into which ADSP is to place the data.
eom
- A flag indicating if the last byte that ADSP read was a logical end-of-message indicator. If the last byte constitutes an EOM,
ADSP sets this parameter to 1. If not, it sets this parameter to 0.DESCRIPTION
ThedspRead
routine reads data from an ADSP connection. You can continue to read bytes as long as data is in the receive queue, even after you have called thedspClose
routine or after the remote connection end has called thedspClose
ordspRemove
routine. ThedspRead
routine completes execution when it has read the number of
bytes you specify or when it encounters an end of message (that is, the last byte
of data in an ADSP packet that has the EOM bit set in the packet header).You can call the
dspStatus
routine to determine the number of bytes remaining to be read from the read queue, or you can continue to call thedspRead
routine until theactCount
andeom
parameters both return 0.If either end closes the connection before you call the
dspRead
routine, the command reads whatever data is available and returns the actual amount of data read in theactCount
parameter. If the connection is closed and there is no data in the receive queue, thedspRead
routine returns thenoErr
result code with theactCount
parameter set to 0 and theeom
parameter set to 0.ASSEMBLY-LANGUAGE INFORMATION
To execute thedspRead
routine from assembly language, call the_Control
trap macro with a value ofdspRead
in thecsCode
field of the parameter block.RESULT CODES
noErr 0 No error errFwdReset -1275 Read terminated by forward reset errState -1278 State isn't open, closing, or closed errAborted -1279 Request aborted by dspRemove
ordspClose
routineerrRefNum -1280 Bad connection reference number