1<html><head>
2	<title>Metakit sample code - CatRecv</title>
3</head><body bgcolor=white>
4
5<font face=Helvetica size=3>
6
7<!--begin-->
8<h2><img src="e4app.gif" alt="App Icon" border=0 align=left>
9Metakit sample code - CatRecv</h2><br clear=left>
10
11<p>This application is a simple TCP/IP server based on Winsock. </p>
12
13<p><b>What it does</b>: When CatRecv is started, is enters a loop waiting
14for the CatSend client application to connect. Each new connection sets
15up its own window to displays the contents of a catalog tree sent by CatSend.
16You can examine the catalog tree and verify that it actually contains what
17the DisCat sample program previously saved on file. </p>
18
19<p><b>What it illustrates</b>: CatRecv is pretty neat. Apart from illustrating
20how to transfer a complex Metakit data structure over a network connection,
21it shows off the new tree and list controls now available in Windows 95
22with MFC 4.2, and it demonstrates how to design a little TCP/IP network
23server. The catalog window uses an Explorer-like tree interface to allow
24you to easily examine a catalog tree structure, and it didn't even take
25a lot of work to create it in C++. Since this is mainly intended as a demonstration
26of the use of Metakit, some more fancy user-interface features, such as
27sortable file lists and splitter views were not included, although this
28is probably quite easy to add. </p>
29
30<p><b>How to use it</b>: As it is, CatRecv only makes sense in combination
31with CatSend and DisCat. To try it out, you should first create a catalog
32file with DisCat which you can then pick up with CatSend. Note that like
33any typical client-server application, the CatRecv server application must
34be running before using CatSend to open a connection. Whenever a new connection
35is opened and a catalog object is received, CatRecv will open a new window
36with the contents of that catalog. </p>
37
38<p>This sample application uses a fixed TCP/IP port for its communication,
39but you can change the default port number to any value you like in the
40opening dialog. Just make sure to use the same port number in CatRecv,
41or you won't be able to connect. </p>
42
43<p><b>Known problems</b>: None, but since CatRecv uses both the new Windows
44common controls and Winsock, you can only run this application on Windows
4595, and you need to have a correctly installed version of the TCP/IP protocol
46stack (such as the one that comes with Windows 95 itself). </p>
47
48<p>You do not need an active network connection or any network hardware,
49since every TCP/IP installation can select local communication by using
50&quot;localhost&quot; as a host name (i.e. IP address 127.0.0.1). If you
51obtained this package from Internet via FTP, then you should be all set,
52since FTP access implies that you have a properly working TCP/IP configuration.
53</p>
54
55<p><b>Files in EXAMPLES\CATRECV</b>: </p>
56
57<p>CATRECV.H, CATRECV.CPP - Main MFC application code 
58<br>CATRECV.MAK, CATRECV.MDP - MSVC 4.2 project makefiles for Win32 
59<br>CATRECV.RC - Application resources 
60<br>MYDLG.H, MYDLG.CPP - Opening dialog 
61<br>RESOURCE.H - Resource symbol definitions 
62<br>STDAFX.H, STDAFX.CPP - Used for precompiled headers 
63<br>TREEDLG.H, TREEDLG.CPP - Contains the interesting pieces of this application
64
65<br>RES\*.* - Application resources </p>
66<!--end-->
67
68<center><p><hr size=1>
69||
70&nbsp; <a href="index.html" target="_top">Roadmap</a>
71&nbsp; <a href="classes.html">Class Index</a>
72&nbsp; <a href="samples.html">Sample Index</a>
73&nbsp; ||
74&nbsp; <a href="intro.html">Introduction</a>
75&nbsp; <a href="tips.html">Tips and Tricks</a>
76&nbsp; || 
77
78</center>
79</font>
80
81</body></html>
82