C node ERL_TICK question

Hal Snyder hal@REDACTED
Thu Aug 21 19:35:41 CEST 2003


Is it necessary to respond to an ERL_TICK? We are working on an OTP
project that will involve C nodes talking to OTP nodes. Here's the
general approach, using ei from R9C:

ei_connect_xinit
  initialize C node

ei_xconnect
  connect to OTP node

while(1) {

  ... time passes ...

  ei_reg_send
    ask the OTP node for something

  ei_xreceive_msg
    get answer from OTP node
}


We understand that receive routines such as ei_xreceive_msg will
automatically reply to a tick message as well as pass ERL_TICK to the
C node calling code.

The question is, do we need to be listening all the time? 

We would like to open a connection to an OTP node, but then we might
not use it for hours at a time. Will we lose the connection to the
remote OTP node if we don't continually listen for (and respond) to
ticks?

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