This is a pre-processed version of the web page http://info-igor.org/IgorMessages/2019/03/Info-Igor_2019-03_0028.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 andyfaff at gmail.com Thu Mar 28 13:53:27 2019
From: andyfaff at gmail.com (Andrew Nelson)
Date: Fri, 29 Mar 2019 07:53:27 +1100


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: <CAAbtOZf90Tvnj4d=byP59A1KktAccLPoFcK7ER6=18gKH_HhZw@mail.gmail.com>

Joseph,
if you're getting the messages being printed out in the command window,
that's good because the messages are actually being received. The messages
should be automatically placed in the text bufferwave you provide, always
filling out the last row. SOCKIT was not specifically designed for
request/response, it was designed for synchronous and asynchronous (i.e.
your situation) communication. There may be an upper limit as to the volume
of material it can process though.

1) It may be worth trying to use the example I gave because it showed that
at the raw socket level the thing actually works, and that the message was
going into a wave. Any communication via TCP sockets is just stuff coming
in and out. Only when you get to a protocol (e.g. http) does it matter what
order stuff happens in and what the messages are.
2) Make sure you haven't set the /NOID flag.
3) Try making the connection without the /PROC flag to start with. The
messages should just pile up in the bufferwave. What precisely is the
remote server sending? If it's binary instead of text then a table may not
display them.
4) If step 3 works then try using a processor function. Make sure the
procedures are compiled otherwise nothing will happen.


On Fri, 29 Mar 2019 at 02:50, DiVerdi,Joseph <Joseph.DiVerdi at colostate.edu>
wrote:

> 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://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
>


--
_____________________________________
Dr. Andrew Nelson


_____________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://info-igor.org/attachments/20190329/abaa14f6/attachment.html>