[Xorp-hackers] Q: Can't validate start of process protoC

Liang Qin lqin@sce.carleton.ca
Thu, 04 Mar 2004 10:00:06 -0500


Orion Hodson wrote:

>/-- Liang Qin wrote:
>| Hi XORP users,
>| 
>| I'm porting a routing protocol "protoC" to XORP v.0.5, I have a problem 
>| when I launch
>| this module in XORP.
>| 
>| Here is part of error message:
>| --------------------
>| New module has PID 4406
>| step1_done (protoC)
>| step2 (protoC)
>| validate
>| XRL: >finder://protoC/common/0.1/get_status<
>| [ 2004/03/03 15:23:35  WARNING xorp_rtrmgr:4403 XrlFinderTarget +376 
>| finder_base.cc handle_finder_0_2_resolve_xrl ] Handling method for 
>| finder/0.2/resolve_xrl failed: XrlCmdError 102 Command failed Target 
>| "protoC" does not exist or is not enabled.
>| *-*-*- start running protoC target
>| ***************the protoC status is 3
>| --------------------------
>| This error message will repeat until this module is killed.
>| 
>| The printout messages are added by me, we can see that the target is 
>| running from its status code.
>| 
>| It'll work if I add a infinite loop late, like
>| while(true)
>|     e.run();
>| 
>| e is an instance of EventLoop
>| 
>| My question is
>| 1. Does this error message mean that protoC process is not up? or rtrmgr 
>| cannot find the process?
>
>Yes.
>  
>
But I checked the protoC module (target) status, it's in "PROC_READY".

>| 2. Do I have to use the infinite loop?
>
>Yes.  XORP is single-thread.  All processing is done on the basis of timers 
>and file descriptor.  Events are dispatched out of the eventloop.  Ideally, 
>your application will just loop about eventloop.run() after start up and call 
>it from just one place.  A good example of this is the standalone Finder 
>process in libxipc/finder_main.cc.
>
>  
>
Yes, I fond the example in finer_main.cc, which uses infinite loop:
while (gbl_sig_exit == false) {
        e.run();
    }

The problem is that there is another infinite loop in my protoC after 
launching the taget.
I tried to put e.run() in this loop and remove the first one, it doesn't 
work.

Thanks!

Liang