tfGetOobDataOffset

Jump to: navigation, search

Table of Contents >> Programmer's Reference


#include <trsocket.h>


int tfGetOobDataOffset (int socketDescriptor);


Function Description

This function is used to get the offset of the out of band data sitting in the receive queue. This allows the user to determine where the out of band data is located in the stream. The tfIoctl() call with the SOIOCATMARK request can be used instead of the tfGetOobDataOffset() call, but the tfIoctl() call only tells us whether we are at the out-of-band byte mark, whereas the tfGetOobDataOffset() call gives us the offset to the out-of-band byte. See recv() call for out-of-band data description.


Parameters

  • socketDescriptor
    The socket descriptor to get the number of bytes in the data stream to the out-of-band data offset.


Returns

  • >= 0
    The number of bytes in the data stream to the out-of-band data offset.
  • TM_SOCKET_ERROR
    Failure.


Note Note: TM_SOCKET_ERROR means that this socket call has failed and the errorCode has been set on the socket itself.

To retrieve the socket error the user must call tfGetSocketError(socketDescriptor).


Possible socket errors

  • TM_EBADF
    'socketDescriptor' is not a valid descriptor.
  • TM_EINVAL
    No out-of-band data is waiting to be read.


Table of Contents >> Programmer's Reference