C node ERL_TICK question

Vance Shipley vances@REDACTED
Thu Aug 21 23:32:14 CEST 2003


Hal,

Yes you should have a select/poll as or in your main loop.
When the ei socket(s) are readable run the appropriate function
to process the request and then go back to what you were doing.
The ei*receive* functions handle the ERL_TICK and other stuff.

If you are not using poll() but are doing a blocking call of some
other kind as your main loop you should have it time out
occasionally and run a non-blocking poll (or select) or even just 
run one of the ei*receive* functions and ignore errors.

If you don't have a "wait" option in the blocking function set up
a signal handler for SIGALARM and call alarm(timout) to interrupt
the blocking call every so often and go and check things on the
ei socket(s).

	-Vance


On Thu, Aug 21, 2003 at 12:35:41PM -0500, Hal Snyder wrote:
}  
}  If so, it suggests you we either a select/poll loop controlling the
}  program, or a thread whose job it is to keep the connection alive.
}  Correct?



More information about the erlang-questions mailing list