So, I've been investigating the various options regarding network communication and Igor and was essentially wondering if it is possible to run Igor as a TCP/IP server. I know I can send packets via TCP/IP using the SOCKIT XOP, but I'm unsure of the possibility of reading TCP/IP traffic entirely within Igor (I've read the "external access" section of the Wavemetrics website and it seems Igor is capable of functioning as a server in some capacity). For this particular task, I'm essentially processing data with Igor on one computer, and would like to send the processed data to another computer also running Igor. I know that since Igor can be controlled by batch files, worst comes to worst I could write an external server program which would receive the traffic and control Igor indirectly, but it would obviously be much cleaner and faster if this step could be skipped. Any advice would be greatly appreciated!
I actually wrote an external "spider server" program at one stage (not an XOP) that would receive external connections and forward them on to another connection which was listened to by SOCKIT. Using this program I was controlling IGOR remotely, as I was sending strings that were then execute/P/Q from the command line. Of course if I'd wanted to I could've sent stuff back to the server based on the structure of the request that was received. However, setting an IGOR procedure up to handle different webbased protocols would've been insane (http, ftp, etc).
The reason I didn't make that public was that there are obviously huge security ramifications with such server programs. If they are exposed to the "internet", they have to be hardened, strong password secure, etc. Plus one has to be sure of the messages passing between the server and IGOR, the protocol, etc. I didn't want to be responsible for somebodies computer getting hacked up. Plus, how does one make it scalable, i.e. what happens when it receives many connections? Does it fork/thread, etc? That was a whole world of complicated pain, between platforms. I got the server code off the internet and adapted it, it's not hard to do (easier on OS X). Unfortunately it doesn't seem to be on my computer anymore.
I also briefly considered writing a server XOP, but got stalled by the same considerations, although I did start some stuff. It's a big project for an XOP.
could be used as a basis for an external program. You'd have to use pthreads, which would necessitate using pthreadsWin32 project. You would have to build in some way of communicating with IGOR, etc.
execute/P/Q
from the command line. Of course if I'd wanted to I could've sent stuff back to the server based on the structure of the request that was received. However, setting an IGOR procedure up to handle different webbased protocols would've been insane (http, ftp, etc).The reason I didn't make that public was that there are obviously huge security ramifications with such server programs. If they are exposed to the "internet", they have to be hardened, strong password secure, etc. Plus one has to be sure of the messages passing between the server and IGOR, the protocol, etc. I didn't want to be responsible for somebodies computer getting hacked up. Plus, how does one make it scalable, i.e. what happens when it receives many connections? Does it fork/thread, etc? That was a whole world of complicated pain, between platforms. I got the server code off the internet and adapted it, it's not hard to do (easier on OS X). Unfortunately it doesn't seem to be on my computer anymore.
I also briefly considered writing a server XOP, but got stalled by the same considerations, although I did start some stuff. It's a big project for an XOP.
March 1, 2010 at 12:57 pm - Permalink
www.cs.utah.edu/~swalton/listings/articles/tcpserver.c
could be used as a basis for an external program. You'd have to use pthreads, which would necessitate using pthreadsWin32 project. You would have to build in some way of communicating with IGOR, etc.
March 1, 2010 at 01:04 pm - Permalink