home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
VSCPPv8.zip
/
VACPP
/
IBMCPP
/
samples
/
TOOLKIT
/
OS2
/
NPIPE
/
README
< prev
next >
Wrap
Text File
|
1995-06-08
|
3KB
|
110 lines
NPIPE - Named Pipes
DESCRIPTION:
NPIPE demonstrates two-way communication between two unrelated processes
using named pipe functions. This sample program implements the game of
tic-tac-toe with two executable files, CLINPIPE.EXE (the client) and
SVRNPIPE.EXE (the server). The server is the computer, and the client
is the user. For example, the client will:
- Connect to the server and acknowledge successful connection
(START_MSG).
- Notify the server through a pipe when it wishes to begin play
(YOU_FIRST or CLIENT_MOVE).
- Notify the server when it wishes to quit (CLIENT_QUIT).
- Send the server a valid move when requested by the server
(CLIENT_MOVE).
In turn, the server will:
- Upon the initial request of a client to play, connect a pipe
to the client through which play will be executed (START_MSG).
- Be able to play with many clients simultaneously.
- Notify the client of the server's move, and request a valid move
from the client (SERVER_MOVE).
- Notify the client of game-end (WIN_SERVER, WIN_CLIENT, WIN_DRAW).
TASK:
Play Tic-Tac_Toe using named pipes.
CONCEPT/FEATURE:
Illustrate the use of Presentation Manager, threads and named pipes.
SAMPLE LOCATION:
Inside the OS/2 Sample Programs folder (which is inside the VisualAge C++
Samples folder).
Note:This sample is not provided in project form.
SOURCE FILE LOCATION:
X:\ibmcpp\samples\toolkit\os2\npipe
where X: is the drive you installed the samples and document component
of VisualAge C++ for OS/2.
HOW TO RUN THE SAMPLE:
-From your OS/2 desktop:
Double-click on the sample's icon.
-From an OS/2 command prompt:
To start a non-WorkPlace Shell sample program from an OS/2 command
prompt, type the name of the executable file and press Enter. If you
have edited source code of a sample program and want to recompile,link,
and run the files, use the NMAKE tool. Your output is the executable
file. For information about the NMAKE utility, see the OS/2 Tools
Reference.
SOFTWARE/HARDWARE PREREQUISITES:
- IBM VisualAge C++
- OS/2 Warp
- IBM or compatible 386 and up.
REQUIRED FILES DESCRIPTION
clidlg.ipf Input to the IPF compiler for *.inf generation
clifile.ipf Input to the IPF compiler for *.inf generation
clinpipe.def link definitions files
clinpipe.exe The executable
clinpipe.hlp Help resource file
clinpipe.ipf Input to the IPF compiler for *.inf generation
clinpipe.rc Resource compiler input
clioptn.ipf IPF compiler input
clnpglbl.h
clnphelp.c Interface routines to the Help manager
clnphelp.h
clnphelp.rc Resource compiler input
clnpmain.c The main() file
clnpmain.h
clnpthrd.c Threads support routines
clnpxtrn.h
help.ipf
file.ipf
dlg.ipf
namepipe.h
namepipe.ico
svrnpipe.exe
svrpgame.c
svrpmain.c
svrnpipe.hlp
svrpglbl.h
svrpmain.h
svrnpipe.ipf
svrphelp.c
svrppnt.c
svrphelp.h
svrpthrd.c
svrnpipe.def
svroptn.ipf
svrphelp.rc
svrpxtrn.h