SOCKET consists of three client/server samples and SELECTS.C located in \TOOLKIT\SAMPLES\TCPIPTK\SOCKET.
SELECTS.C is a simple TCP and UDP server that uses the BSD select() call. MSGC.C/MSGS.C, TCPC.C/TCPS.C, and UDPC.C/UDPS.C are sample C socket client/server programs demonstrating network programming with OS/2 sockets.
The following explains how to build and run the SOCKET samples.
nmake -f vacpp.mak (to build using the VisualAge C/C++ compiler)
a.
start udps
An additional session is created and the following message is displayed:
Port assigned is 1028
udpc 9.67.60.10 1028
where:
Received message Hello ................
a.
start tcps 2000
where 2000 is the port number assigned to the tcps server. b.
tcpc charm 2000
where:
charm
The selects server has the same function as the tcps and udps servers.
a.
start selects 2000
where 2000 is the port number assigned to the selects server. b.
tcpc charm 2000
where:
charm
udpc 9.67.60.10 2000
where:
Received message Hello ................5.
msgs.c and msgc.c are the same program as udps.c and udpc.c, except they are written using recvmsg() and sendmsg() calls.
a.
start msgs
An additional session is created and the following message appears:
Port assigned is 1028b.
msgc 9.67.60.10 1028
where: