The best way to write a server from scratch is probably by using the TINE server wizard. The next best way is to make a copy of a working server and then make modifications to suite the needed functionality. To this end it is instructive to follow the Build Recipe outlined below. Note that the build instructions apply to Solaris, HP-UX, SGI, OSF, Linux, FreeBSD.
- Make a directory on your machine called TINE, for example DISK$MPY:[JOE.TINE].
- Locate the TINE distribution, and via ftp copy all files in kernel/source to the directory you just created. For example:
ftp mkinthera1
ftp> cd hera/kernel/source
ftp> prompt
ftp> asc
ftp> mget *
- Go to either platform/vms.vx or platform/vms.ax in the TINE distribution, depending on whether you are compiling for ALPHA VMS or VAX VMS. From there you should get all the files you see.
You’ll end up with com files: srv.com, and cln.com, a server example and a client example. You will also get a copy of “project.def” for your VMS platform. For example (same ftp session as above):
ftp> cd platform/vms.vx
ftp> mget *
- Go the source/example directory in the TINE distribution and get all of the example source modules you see:
ftp> cd ../../example
ftp> mget *
- Get out of ftp and execute the com file:
@srv.com
- Edit the file fecid.csv and give your server a more meaningful (albeit unique) server name than “MYFEC”.
- Edit the file exports.csv and make sure all references to “MYSINE” are likewise changed to something more meaningful (but nonetheless system-wide unique).
- Run the executable you just made by typing:
run rpcserv.exe
If a name-server is configured and running, this server will automatically plug itself into the system-wide database. If a name-server is not running, then you will have to modify database entries by hand to include the address and name information pertaining to your server.
- You have full control over the contents of the files copied to the working directory (in this example) DISK$MPY:[JOE.TINE]. In particular, you will probably want to edit (in not change the module name) sinsrv.c to meet your needs. You may not have to touch rpcserv.c at all, but you can if you need to add something to the main loop