help-octave
[Top][All Lists]
Advanced

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

Re: what to send to "listen"


From: Doug Stewart
Subject: Re: what to send to "listen"
Date: Thu, 17 Aug 2006 21:24:45 -0500
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)

Take a look at

http://velveeta.che.wisc.edu/octave/lists/help-octave/2006/993

I have it working in C#

Doug Stewart

Eric S. Carlson wrote:
Hello,
Many apologies for the stupidity of this question, but I need a little more
info about how to use the "listen" command. In particular, I am trying to
get octave to work with python through sockets.

What I can do:
start octave
start listen
in python, I can successfully create a socket connection using:
    s = socket(AF_INET, SOCK_STREAM)    # create a TCP socket
    s.connect((serverHost, serverPort)) # connect to server on the port


What I need:
    1. What strings (or whatever) do I send to octave to get it to evaluate
a command
         for example:
            s.send("x=3")               # send something to assign 3 to
variable x
    2. Once I get octave to accept my command, how do I retrieve the
response?
           data = s.recv(1024)                 # receive up to 1K bytes
           print data
    3. If I can successfully communicate, does octave create a workspace so
that after sending a previous definition for x I could use a command like s.send("y=3*x") and have it make sense to octave? At this point, I think the issues are what strings/data to send to and
retrieve from octave, and not the use of sockets in python, but I am new at
this as well so I may have this totally screwed up.

I would appreciate any info anyone might provide on these issues.

Thanks,
Eric



reply via email to

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