tfGetWaitingBytes

Jump to: navigation, search

Table of Contents >> Programmer's Reference


#include <trsocket.h>


int tfGetWaitingBytes (int socketDescriptor);


Function Description

This function is used to get the number of bytes waiting to be read on a socket. The tfIoctl() call with the FIONREAD request can be used instead.


Parameters

  • socketDescriptor
    The socket descriptor to check on the amount of waiting bytes.


Returns

  • >= 0
    Number of bytes waiting to be read.
  • 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.


Table of Contents >> Programmer's Reference