![]() |
![]() |
![]() |
![]() |
mti_AddSocketOutputReadyCB()
Adds or removes a socket output ready callback.
Syntax
mti_AddSocketOutputReadyCB( socket_desc, func, param )Returns
Arguments
Description
mti_AddSocketOutputReadyCB() puts a watch on the specified socket descriptor. Whenever the socket descriptor is available for writing, the specified function is called along with its parameter.
To remove a previously added callback, call mti_AddSocketOutputReadyCB() with the same socket descriptor but with a NULL function pointer.
mti_AddSocketInputReadyCB() and mti_AddSocketOutputReadyCB() are useful in setting up cosimulation environments where FLI code uses sockets to communicate with other processes. In the course of initialization, a cosimulation application typically would use standard system library routines to create or open a socket and obtain a socket descriptor and then call mti_AddSocketInputReadyCB() and mti_AddSocketOutputReadyCB() to set up the callback functions. During simulation, FLI code may initiate a non-blocking I/O operation on the socket (again using standard system library routines) and immediately return control to the simulator. When the I/O is completed, the simulator invokes the callback function which could check for errors, handle received data, or initiate another non-blocking I/O operation before returning to the simulator.
Related functions
![]() Model Technology Inc. Voice: (503) 641-1340 Fax: (503)526-5410 http://www.model.com sales@model.com |
![]() |
![]() |
![]() |
![]() |