creating a time out feature

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • carobee
    New Member
    • Jun 2007
    • 14

    creating a time out feature

    hi

    i wanted to incorporate a time out feature in while reading message queues in my program. i think i have to use threads but i m not able to visualise the logic.

    can anyone help? im in urgent need
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Probably you need to use threads.

    A thread is a function. The thread runs as long as the function runs.

    The function has to have a specific function prototype for it to be usable as a thread function.

    Threads are created by _pcreate_thread (Unix/Linux) and CreateThread(Wi ndows).

    Start your research there.

    Comment

    • carobee
      New Member
      • Jun 2007
      • 14

      #3
      thnks for the quick reply
      i have to collect the message in php on the other side. what i designed follows like this
      1)sent the message from php script to C prog
      2)if C prog receives , then sends a ack to php script
      3)php script receives the ack from php.meanwhile C prog monitors the message queue for in coming messages. if there is no message the for atleast say some sec, then sends a nack
      4)the php script on receiving the nack should time out.

      i have finished till step 3, but the prob that im facing is while the C prog is sending the nack, this nack is not able to create the time out feature in php

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        I can't help you with php. Sorry.

        I am going to move this to the PHP forum.

        Comment

        Working...