This is a pre-processed version of the web page http://info-igor.org/IgorMessages/2019/03/Info-Igor_2019-03_0024.html. In this copy, the search terms dsites.com (0) have been highlighted to make them easier to find. If a search term was not found, then it may exist in the non-visible title, description, keywords or URL fields, or the contents of this document may have changed since it was indexed.

Some web pages will not display properly in this pre-processor. Visit those pages directly by following this link. Visit the page itself before bookmarking it.

The search engine that brought you here is not necessarily affiliated with, nor responsible for, the contents of this page.

SOCKIT experimentation From DKeeleJr at Comcast.net Thu Mar 28 10:12:06 2019
From: DKeeleJr at Comcast.net (Don Keele)
Date: Thu, 28 Mar 2019 13:12:06 -0400


Subject: SOCKIT experimentation
In-Reply-To: <be954704-8078-9d34-fb7e-1c0ab239ed40@colostate.edu>
References: <c118ed45-e109-2465-2810-727b63587bb0@colostate.edu>
<CAAbtOZdU252kpRK5qssqv_GbGgWmF6Kt+3Pkgyru86pmJUo5Uw@mail.gmail.com>
<be954704-8078-9d34-fb7e-1c0ab239ed40@colostate.edu>
Message-ID: <00dc01d4e589$5f832ee0$1e898ca0$@net>

Hi All,
Hey, I'm just an innocent ignorant observer here! What the heck is a SOCKIT
and what does it provide in an Igor program? I'm a simple, lowly, and
unsophisticated audio guy!

--
Best Regards,
Don Keele

D. B. (Don) Keele, Jr.
Chief Consultant and Owner
DBK Associates and Labs
6435 E. Wellston Dr.
Bloomington, IN 47408
Cell: (812) 219-3951
mailto: DKeeleJr at Comcast.net
Skype: donkeele
http://www.DBKeele.com/




-----Original Message-----
From: Info-igor [mailto:info-igor-bounces at lists.info-igor.org] On Behalf Of
DiVerdi,Joseph
Sent: Thursday, March 28, 2019 11:50 AM
To: Igor Discussion List
Subject: Re: SOCKIT experimentation

Andy,

Thanks very much for the response. However, my situation is substantially
different from the one that you describe.

For starters I'm not using a HTTP server. My custom-made server acts
differently than a typical HTTP server - once a connection is made the
server continually emits \n terminated strings of data, several per second
until the connection is severed. This is its design. It recovers gracefully
from the connection closure and is then immediately ready for another
connection. Its behavior is better visualized and tested using telnet with
the server's IP address (it is on another machine on my LAN) and port number
rather than a browser. I'm not really asking about the server this is a part
of the project - it's pretty much settled.

I am asking about SOCKIT especially about some particular behavior: When I
open a socket with SOCKIT (I actually love writing that rather than a
connection with SOCKIT) I immediately get the remote emitted messages
printed (with vigor) in Igor's history. No surprise here. I can silence
these messages using a Q flag on the open connection call. Good stuff again.
However, I have not yet been able to capture those incoming messages in the
textWave nor using the myPocessorFunc (both as you call it below and
described in the SOCKIT docs).

It looks to me that SOCKIT has been (specifically?) designed to model the
request-response style of communication (ala HTTP client-server) and cannot
handle a continuous emitter such as my server. Perhaps you (or someone else
on the list) has experience with my particular problem and can speak with
authority about SOCKIT's capabilities in this particular and somewhat
different connection protocol.

Thanks again for your response. It's ALWAYS good to hear from kindred
spirits and from others fooling around with the same toys.

Best regards,
Joseph

On Wed, 27 Mar 2019 9:53 PM, Andrew Nelson wrote:
> 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://lists.info-igor.org/private.cgi/info-igor-info-igor.org/attachments/
20190328/cbec57f7/attachment.html>
> _______________________________________________
> Info-igor mailing list
> Info-igor at lists.info-igor.org
> http://lists.info-igor.org/listinfo.cgi/info-igor-info-igor.org
>

--
Joseph A. DiVerdi, Ph.D., M.B.A.
Associate Professor of Chemistry
Colorado State University, Fort Collins, CO, USA
+1.970.980.5868 - http://sites.chem.colostate.edu/diverdi

_______________________________________________
Info-igor mailing list
Info-igor at lists.info-igor.org
http://lists.info-igor.org/listinfo.cgi/info-igor-info-igor.org