Universität Ulm, Fakultät für Mathematik und Wirtschaftswissenschaften, SAI

Socketmodul zur Systemnahen Software I (WS 97/98)

Hier eine Beispiel zur Anwendung von sock:

melzer@thales:~> gcc -Wall -c testsock.c
melzer@thales:~> gcc -Wall -lsocket -lnsl -o testsock testsock.o sock.o
melzer@thales:~> testsock turing
I am now on port 35180.
Please enter other player's port: 57698
Sending Hallo no args to turing on port 57698.
I got: Hallo arg 3.
Sending Another line to turing on port 57698.
I got: Another line.
melzer@thales:~>
Entspechende Ausführung auf turing:
melzer@turing:~> testsock thales 35180
I am now on port 57698.
Sending Hallo arg 3 to thales on port 35180.
Line sent.
I got: Hallo no args.
Sending Another line to thales on port 35180.
I got: Another line.
melzer@turing:~> 

Und hier ist endlich die versprochene Datei sock.sh.
Universität Fakultät SAI

Ingo Melzer, 18. Dezember 1997