help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is best way to trigger Octave via ethernet?


From: Przemek Klosowski
Subject: Re: What is best way to trigger Octave via ethernet?
Date: Thu, 31 Mar 2016 12:59:16 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 03/31/2016 10:54 AM, Vision wrote:

I'm able to send TCP packets from the PLC to a specific IP and port.
Is there an option in octave to listen to this specific port and get
triggered when data is transferred. I also think that avoiding a loop is
better?
There's even a way of doing what you want by calling an external network listener from your .m code:

   system("nc -l localhost 8080")

will sit there waiting until the netcat (nc) program returns, which will happen when you connect to localhost:8080; you can test that by executing

   echo test | nc localhost 8080

from another terminal. 'nc -l'  opens a socket in a listening mode and does a select() on it;  as others have pointed out, you can write an equivalent code in your .oct file.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]