Community discussions

MikroTik App
 
ktiedt
just joined
Topic Author
Posts: 12
Joined: Mon Sep 07, 2009 1:16 am

Limitations of API (max writes before reading?)

Thu Sep 17, 2009 7:10 am

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
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6196
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

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

Thu Sep 17, 2009 9:21 am

Whenever you send command to router, it responds immediately.
 
ktiedt
just joined
Topic Author
Posts: 12
Joined: Mon Sep 07, 2009 1:16 am

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

Thu Sep 17, 2009 10:33 am

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?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8526
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

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

Thu Sep 17, 2009 11:34 am

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
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ktiedt
just joined
Topic Author
Posts: 12
Joined: Mon Sep 07, 2009 1:16 am

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

Thu Sep 17, 2009 12:22 pm

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
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6284
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

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

Tue Sep 22, 2009 12:43 pm

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"
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8526
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

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

Wed Sep 23, 2009 12:38 am

then, as far as I remember, you can simply increase ReceiveBuffer size =)
Russian-speaking forum: https://forum.mikrotik.by/. Welcome!

For every complex problem, there is a solution that is simple, neat, and wrong.

MikroTik. Your life. Your routing.
 
ktiedt
just joined
Topic Author
Posts: 12
Joined: Mon Sep 07, 2009 1:16 am

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

Wed Sep 23, 2009 1:18 am

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.

Who is online

Users browsing this forum: satman1w and 15 guests