From matthias.kastner at byte-physics.de Thu Mar 28 10:22:44 2019
From: matthias.kastner at byte-physics.de (Matthias Kastner)
Date: Thu, 28 Mar 2019 18:22:44 +0100


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

Hi there.

You could take a look at the project description:

https://www.wavemetrics.com/project/SOCKIT

In principlal, it allows you to communicate with network sockets. Take
a look at unix socket introduction, if you are interested in this
concept. I think, translated for audio people it refers to the problem
when two programs want to simultaneously output audio to a hifi stereo
system then you can either give them separate channels (one outputs
right and one outputs left channel) Your services then are linarly
independent to each other but that approach is not very practical. They
can also share a common mixer which is the socket. The mixer now allows
audio signals to pass through depending on which instance takes over
the socket.

For http sockets, it is mostly communication for web services that is
coordinated through these sockets. Say for example, you have a database
but want to coordinate writes so that two instances don't change the
same database object at the same time leading to a conflict.

In unix, sockets are a very basic concept that will remain over time so
it is worth to take a look.

Regards,

Matthias (a nanoscience guy)

On Thu, Mar 28, 2019 at 6:12 PM, Don Keele <DKeeleJr at Comcast.net> wrote:
> 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
>
> _______________________________________________
> Info-igor mailing list
> Info-igor at lists.info-igor.org
> http://lists.info-igor.org/listinfo.cgi/info-igor-info-igor.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://info-igor.org/attachments/20190328/f104542b/attachment.html>