Table of Contents Previous page Next page Index

ModelSim

Model Technology Inc.


mti_AddSocketOutputReadyCB()

Adds or removes a socket output ready callback.

Syntax

mti_AddSocketOutputReadyCB( socket_desc, func, param ) 

Returns

Nothing

Arguments

Name
Type
Description
socket_desc
int
A socket descriptor
func
mtiVoidFuncPtrT
A pointer to a function to be called whenever the socket descriptor is available for writing
param
void *
A parameter to be passed to the function; OPTIONAL - can be NULL

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

mti_AddInputReadyCB()

mti_AddOutputReadyCB()

mti_AddSocketInputReadyCB()



Model Technology Inc.
Voice: (503) 641-1340
Fax: (503)526-5410
http://www.model.com
sales@model.com
TOC PREV NEXT INDEX

ModelSim