Page 1 of 1

Limitations of API (max writes before reading?)

Posted: Thu Sep 17, 2009 7:10 am
by ktiedt
Anyone know what the limitation is of write commands before requiring to read?

I been testing and it seems 3 or so commands come back at the most.... curious if there is a spec for that in particular or way of telling for sure?
(maybe its not command count, but returned data that limits it?)

Thanks

Re: Limitations of API (max writes before reading?)

Posted: Thu Sep 17, 2009 9:21 am
by mrz
Whenever you send command to router, it responds immediately.

Re: Limitations of API (max writes before reading?)

Posted: Thu Sep 17, 2009 10:33 am
by ktiedt
I understand that, but part of the "benefits" of this API is the ability to send more than one command before reading yes?

From janisk (in other thread about the API I started) "i can easily run several commands at once and receive responses in a known way, without mixing everything up."

so If I wanted to batch several commands together to retrieve in the same (single) read... What is the limitation? Or is that not how the above statement is meant?

Re: Limitations of API (max writes before reading?)

Posted: Thu Sep 17, 2009 11:34 am
by Chupaka
From janisk (in other thread about the API I started) "i can easily run several commands at once and receive responses in a known way, without mixing everything up."
it's about running several commands simultaneously. for example, you can monitor traffic on the interface, listen for the changes in Log and do some work with Address Lists in one API connection. but you still need to work with API correctly: write a single command and read a response

Re: Limitations of API (max writes before reading?)

Posted: Thu Sep 17, 2009 12:22 pm
by ktiedt
Thanks Chupaka, thats much more clear than the previous statement, I had previously been doing 1:1 but after that statement decided to test it out

Re: Limitations of API (max writes before reading?)

Posted: Tue Sep 22, 2009 12:43 pm
by janisk
well, to make it clear - when you do API call, you will get answer as soon as response is formed and sent. Depending on your OS there is buffer assigned to your TCP connection that you have to read to receive the responses, usually it is couple packets long (standard 1500 byte ones) when that buffer is full you cannot send in anything, and incoming packets are dropped. And that all depends on OS you are executing your API application.

You can do it that way - create connection - make thread that reads from that socket and then you can just fire those commands to router, and receive responses from that read thread.

If you want more than that, you have to create another connection to router and that will be completely different login session.

edit:
as far as i remember that might be "TCP window"

Re: Limitations of API (max writes before reading?)

Posted: Wed Sep 23, 2009 12:38 am
by Chupaka
then, as far as I remember, you can simply increase ReceiveBuffer size =)

Re: Limitations of API (max writes before reading?)

Posted: Wed Sep 23, 2009 1:18 am
by ktiedt
then, as far as I remember, you can simply increase ReceiveBuffer size =)
much rather just use the API as intended ;) so API tools work w/o changing settings on hosts

thanks for all the info on this, much appreciated.