[Xorp-hackers] Socket error

Pavlin Radoslavov pavlin at ICSI.Berkeley.EDU
Mon Feb 16 11:24:26 PST 2009


illidan <illidan at lineway.net> wrote:

> Hello,
> 
> I was trying to open a socket using socket4 library.
> I used function send_tcp_open_and_bind :
> 
> create_socket.cc :
> void SocketServer::get_create_socket() {
>     XorpCallback2<void, const XrlError&, const string*>::RefPtr cb;
>     IPv4 localIP("10.10.10.10");
>     int localPort = 100;
>     cb = callback(this,&SocketServer::get_socket_id);
>     send_tcp_open_and_bind("fea",_rtr.instance_name(),localIP,localPort,cb);
> }
> void SocketServer::get_socket_id(const XrlError& e,const string* id) {
>     if(e==XrlCmdError::OKAY()) {
>         fprintf(stderr,"I receive the response : %s\n",id->c_str());
>         _socket_id = id->c_str();
>         listen();
>         return;
>     }
> }
> 
> When I run this program, I receive correctly the socket_id, but I get an 
> error in rtrmgr process :
> 
> "[ 2009/02/16 13:11:01 WARNING xorp_rtrmgr:32679 XrlFinderTarget +721 
> ../xrl/targets/finder_base.cc 
> handle_finder_event_notifier_0_1_register_instance_event_interest ] 
> Handling method for 
> finder_event_notifier/0.1/register_instance_event_interest failed: 
> XrlCmdError 102 Command failed failed to add watch
> [ 2009/02/16 13:11:01 ERROR xorp_fea:32681 FEA +128 xrl_fea_io.cc 
> register_instance_event_interest_cb ] Failed to register event interest 
> in instance create_socket: 102 Command failed failed to add watch"
> 
> What could be the problem? Did I do something wrong??

Was your create_socket program still running, and in READY state?

You can verify both by using the following XRL by hand (you need to
replace "fea" with the target name of your module):
libxipc/call_xrl finder://fea/common/0.1/get_status

If everything is normal you should see the following output:
status:u32=3&reason:txt=

FYI, the values for the static codes are listed in
libxorp/status_codes.h and the value for PROC_READY is 3.

Regards,
Pavlin

> Thanks
> 
> Michael
> 
> _______________________________________________
> Xorp-hackers mailing list
> Xorp-hackers at icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers



More information about the Xorp-hackers mailing list