Doesn't it look so simple?
Installation: take these four files (HelloObject.isl, HelloObjectServer.py, HelloObjectClient.py, and Imakefile) and place in an empty directory.
type:
ilumkmf
'ilumkmf' will generate a Makefile. Note: On the HP-UX platform, there might be a couple warning...just ignore them.
type:
make
'make' will generate a couple files (HelloObject.py and HelloObject__skel.py.)
To start the server type:
python HelloObjectServer.py &
The server will print out a bunch of garbage. This garbage is the binding handle the client needs in order to find the server anywhere on the Internet. You will need to use this handle as the first parameter [binding_handle} to HelloObjectClient.py.
Note: The server needs to be place in the background with the '&' symbol at the end of the command line.
To start the client type:
python HelloObjectClient.py "[binding_handle]"
Note: remember to place double quotes around the binding_handle.
The client should print "Hello Stanford DL project!" and exit. The server will continue to wait and process new hello messages.
INTERFACE HelloObject; TYPE Hello = OBJECT OPTIONAL METHODS hello () : ilu.CString END;
#!/usr/local/bin/python # import os, socket, sys, ilu, HelloObject__skel class Hello(HelloObject__skel.Hello): def hello(self): return "Hello Stanford DL Project!"; def main(argv): server = ilu.CreateServer(None, None, None); mach = Hello() print mach.IluSBH() ilu.RunMainLoop() main(sys.argv)
#!/usr/local/bin/python # import sys, ilu, HelloObject argc = len(sys.argv) if argc < 2: print 'usage:', sys.argv[0], '[sbh-machine1]' sys.exit(1) HelloObjectInstance = ilu.ObjectOfSBH(HelloObject.Hello, sys.argv[1]) print HelloObjectInstance.hello() print
NormalObjectRule() DependTarget() InterfaceTarget(HelloObject.isl) #ifdef ADD_PYTHON_LANGUAGE ILUPythonTarget(HelloObject.py HelloObject__skel.py, HelloObject.isl) all:: HelloObject.py HelloObject__skel.py #endif