ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/host/c++/socket++-1.10/test/tpipe.C
Revision: 1.1
Committed: Mon Feb 26 15:02:39 2001 UTC (24 years, 10 months ago) by ab11
Content type: text/plain
Branch: MAIN
CVS Tags: PROJECT_COMPLETION
Log Message:
Test programs for Networking class. Unused by the host

File Contents

# Content
1 // tpipe.cc. Test for -*- C++ -*- socket library
2 // Copyright (C) 1992,1993,1994 Gnanasekaran Swaminathan <gs4t@virginia.edu>
3 //
4 // Permission is granted to use at your own risk and distribute this software
5 // in source and binary forms provided the above copyright
6 // notice and this paragraph are preserved on all copies.
7 // This software is provided "as is" with no express or implied warranty.
8 //
9 // Version: 17Oct95 1.10
10
11 #include <pipestream.h>
12
13
14 int main(int ac, char** av)
15 {
16 iopipestream p;
17
18 if ( p.fork() ) {
19 // I am the parent
20 cout << "parent got: ";
21 while (ac--) {
22 char buf[32];
23 buf [0] = 0;
24 p << ac << endl;
25 p >> buf;
26 cout << buf << ' ';
27 }
28 cout << endl;
29 } else {
30 // I am the child
31 int i;
32 cout << "child got: ";
33 while (p >> i) {
34 p << av[i] << endl;
35 cout << i << ' ';
36
37 }
38 cout << endl;
39 }
40 return 0;
41 }
42
43
44
45