PSERV - a sample TCP/IP client/server pair


Lars J Poulsen (lars@ACC-SB-UNIX.ARPA)
Tue, 9 Aug 88 17:23:47 PDT


PSERV - a sample piece of functional TCP/IP Berkeley socket programming.

Every so often, programmers new to socket programming ask for working
examples. I will give you this small example to play with.

This program is a minimal remote spooling package, intended to solve
a personal problem: I use every day two VMS systems and a Unix system.
In my work area we have a LaserWriter connected to the Unix system,
but I have to ride a sloooow elevator two floors to get to a VMS printer.

I really wanted to write a small "lpd" client, but found that this
would require the cooperation of system managers on both machines, since
(1) LPD will only accept commands from known hosts
(2) LPD will only accept connections from privileged ports (<1024)
    and the Wollongong VMS package enforces this also; you need
    system privileges to get a low-numbered port on WIN/TCP.

So I decided to write my own mini protocol. This program illustrates
the basic mechanism used by any server/client pair, and is small enough
to dink around with fairly safely. [After all, if the system lets an
unprivileged user do it, it must be safe :-) ?]

The client runs un 4.3BSD or VMS/WIN/TCP; the server runs on 4.3BSD.

Enjoy.

        / Lars Poulsen
          ACC Customer Service
--------------------------------- Cut Here --------------------------------
In order not to clutter up TCP-IP unnecessarily (God knows I've done that
enough recently) I've sent the actual source code to UNIX-SOURCES on
BRL-SMOKE.ARPA. This is a relay for comp.sources; I don't know if it is
two-way, so if anyone on the Usenet side needs it, I guess I can mail it.

/ Lars Poulsen



This archive was generated by hypermail 2.0b3 on Thu Mar 09 2000 - 14:43:12 GMT