Thank you.
I try to sum up the operations I need to perform, to see if I understood
correctly.
Basically in my external application I have to set up a socket that
sends json messages and this would be quite simple.
In my nox component, instead, I have to import the "JSONMsg_event" and,
within the "install()" instruction, to handle it with my specific
method, that, in my case, would only save these json messages into a
dictionary, for using them later, according to some conditions.
Is that correct?
A couple of things that I didn't understand:
- I assume I also have to set up a server socket in my nox component, in
order to receive json messages and handle JSONMsg_events. So, I think
this socket has to be already up and running when I handle the event.
So, when do I have to create it and how? Do I have to use messenger.py
channel class?
- Second question, probably related to the first. I think to be pretty
confused about jsonmessenger: what are the jsonmessenger files I could
look into in order to understand fields and methods that I would need to
use? Are the jsonmessenger.cc and jsonmessenger.hh in
nox/src/nox/coreapps/messenger? And, if it is the case, how can I
integrate them into a python component?
Thanks again,
Giorgio
On 24/01/2012 12:28, Kyriakos Zarifis wrote:
Hi Giorgio,
yes, I think using jsonmessenger would be the best approach for this.
you need to implement a send/receive interface on the external
application and in your nox component. For the external application,
it's pretty straightforward - Connect to the jsonmessenger socket and
send json strings. In your nox application you need to register for
JSON messages, and handle them appropriately.
The wiki explains the communication in a few steps (specifically for
the GUI<->NOX, but it will be similar and simpler for any external
app) here
<http://noxrepo.org/noxwiki/index.php/NOX_GUI#Connecting_a_subview_to_a_NOX_component>:
If you want to see a full example, the GUI
<http://tinyurl.com/6p2yl5o> and the monitoring
<http://tinyurl.com/6nv83a3> component in destiny could be a place to
look. I'm afraid it's much more complex than what you need, but the
bits you need are in there if you dig in the code a bit.
On Tue, Jan 24, 2012 at 2:16 AM, Giorgio Mazza
<giorgio.mazza...@gmail.com <mailto:giorgio.mazza...@gmail.com>> wrote:
Hi all!
I have written a simple component in python that works fine.
Now I would to improve it, making it to install flow entries
depending on parameters received from an external application.
In particular I want to pass those parameters via json messages to
my component, which, in my thougths, has to open a "permanent"
socket listening for them, save those parameters in a dictionary
and, as a consequence, decide the desired switch behaviour
(whether install or not a flow entry for the received parameters).
In previous threads I found that I have to use jsonmessenger (even
in python?) or to have a look to discovery.py, but I am not sure
to have understood what I have to do and where in order to realize
such a behaviour.
Could anyone, please, help me?
Thank you in advance,
Giorgio Mazza
_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org <mailto:nox-dev@noxrepo.org>
http://noxrepo.org/mailman/listinfo/nox-dev
_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev