[Olsr-dev] OONF telnet plugin

Henning Rogge (spam-protected)
Wed May 25 12:16:25 CEST 2016


On Wed, May 25, 2016 at 11:53 AM, Gabriel <(spam-protected)> wrote:
> Hi, I'm trying to connect to the oonf's telnet plugin using a posix
> socket. This is my code:
>
> sd = create_socket(address, 2009);
> char *req = "/netjsoninfo graph";
> int sent =send(sd,req,strlen(req),0);
> if(!receive_data_olsr2(sd, &buffer)){
>         return 0;
> }
>
> My problem is that 'recv' inside receive_data_olsr2 hangs
> because I' not receiving anything from the telnet plugin.
>
> Analyzing the connection of 'nc' with wireshark I discovered that telnet
> plugin answer back only after a "FIN" flag.

Most likely because you don't send a "End of Line" at the end of your
command. How should a line-oriented parser (like the telnet one) know
that your command is complete without a EOL or a FIN?

Henning



More information about the Olsr-dev mailing list