Function Prototypes:ttUserSocketCBPacketFunc

Jump to: navigation, search

Table of Contents >> Programmer's Reference >> tfRegisterSocketPacketCB


void ttUserSocketCBPacketFunc (
int socketDescriptor,
ttUserPacketPtr packetUserPtr,
int flags
);


Function Description

This function is defined by the user and called once for every valid incoming packet for the particular TCP streaming socket that was specified when this callback function was registered with tfRegisterSocketPacketCB().

Your device driver can provide additional parameters to this callback function via packetUserPtr->pktuUserParam, if you have defined TM_USE_USER_PARAM in your <trsystem.h>.

Warning Warning: The application must not call any Treck functions that would affect the current socket, as provided in the socketDescriptor parameter. This callback function is called while the socket is locked, to prevent data corruption. Additional calls on the socket by the callback function could deadlock the active thread.
 
Warning Warning: The application should avoid any calls that could cause the current thread to block or wait. If this were to happen, the application could be forced to run for an extended period of time with the socket left in a locked state, which could cause the application to become unresponsive.


Parameters

  • socketDescriptor
    The socket descriptor as given by the user in tfRegisterSocketPacketCB().
  • packetUserPtr
    Pointer to incoming packet that is destined for the socket.
  • flags
    Not currently used.


Table of Contents >> Programmer's Reference >> tfRegisterSocketPacketCB