On Fri, Oct 28, 2005 at 02:01:28PM +0100, Bob.Cowdery@CGI-Europe.com wrote:
Ok, I have an application (this is hobby time not work time) in Python that is a software defined radio, running in two parts over a network. The server and the client part communicate using Pyro (a distributed object protocol for Python). The server is mostly 'C' with Python wrappers. For this experiment I intend leaving the server much as it is except I have to connect to it from Squeak. I guess I would have to use plain sockets and devise a text based message protocol to get these two parts to communicate.
First question - is there any better way (meaning higher level) way to do this communication, perhaps using Squeak on both sides. I could arrange for the server side Squeak to talk to the 'C' processes through named pipes if this makes things easier. The server is on Linux (Suse 9.3) by the way. The client in on Windows XP.
If you want a Squeak server to talk to your 'C process' through OS pipes, you can do this with class PipeableOSProcess. You need to load the packages OSProcess and CommandShell from SqueakMap (PipeableOSProcess is in the CommandShell package). If your 'C process' interacts with the world through stdin and stdout streams, this would be a reasonable thing to do. This only works on Unix/Linux, but it would be fine for your Linux server.
Also, if you want to have two Squeak images running as client and server, it is convenient to have one of them start the other one with "OSProcess thisOSProcess forkSqueakAndDo: [something]" or "OSProcess thisOSProcess forkHeadlessSqueakAndDo: [something]" (to start a headless Squeak server with no UI). You can't do this from your Windows XP system, but if you are developing on your Linux box it may come in handy.
Dave