From andyfaff at gmail.com Wed Mar 27 20:53:46 2019
From: andyfaff at gmail.com (Andrew Nelson)
Date: Thu, 28 Mar 2019 14:53:46 +1100


Subject: SOCKIT experimentation
In-Reply-To: <c118ed45-e109-2465-2810-727b63587bb0@colostate.edu>
References: <c118ed45-e109-2465-2810-727b63587bb0@colostate.edu>
Message-ID: <CAAbtOZdU252kpRK5qssqv_GbGgWmF6Kt+3Pkgyru86pmJUo5Uw@mail.gmail.com>

This works for me on macOS.
1) From a terminal window type "python -m http.server". THis will start a
webserver up, as it starts it'll tell you the IP and port number it will be
serving on. Open a web browser on this IP and port number. You should see a
list of files in the directory you started the server up in. In this
example I use the IP address 0.0.0.0 and port number 8000.

2) In Igor have this in your procedure file:

Function myProcessorFunc(textWave, entry)
wave/t textWave // a reference to the bufferwave of interest
variable entry // which row has just been filled in the bufferwave.
// do something here
print textWave[entry][0]
print " received at"+ textWave[entry][1]
End

2) From IGOR type the following commands:

variable socknum
make/t bufferwave
sockitopenconnection/proc=myprocessorFunc sockNum,"0.0.0.0",8000,bufferwave
sockitsendmsg sockNum,"GET /LOG16-10-27T120232_65.txt HTTP/1.1\r\n\r\n"


The GET command will return the contents of the file. In this case I was
looking at file "LOG16-10-27T120232_65.txt". I see the ****LAST**** entry
of bufferwave fill up and the contents of the file printed to the command
history.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://info-igor.org/attachments/20190328/cbec57f7/attachment.html>