| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| server.cpp | 2023-02-20 | 5.2 kB | |
| AppServer.cpp | 2023-02-20 | 7.1 kB | |
| Eventloop.cpp | 2023-02-20 | 17.1 kB | |
| Eventloop.h | 2023-02-20 | 3.9 kB | |
| InputListener.h | 2023-02-20 | 1.5 kB | |
| TcpClient.h | 2023-02-20 | 2.5 kB | |
| TcpSegment.cpp | 2023-02-20 | 14.0 kB | |
| AppClient.h | 2023-02-20 | 3.5 kB | |
| README.txt | 2023-02-20 | 1.8 kB | |
| TcpConnection.cpp | 2023-02-20 | 38.9 kB | |
| TcpConnection.h | 2023-02-20 | 6.3 kB | |
| TcpConnection.sm | 2023-02-20 | 21.9 kB | |
| TcpConnectionListener.h | 2023-02-20 | 2.1 kB | |
| TcpServer.cpp | 2023-02-20 | 2.3 kB | |
| winsock_strerror.cpp | 2023-02-20 | 4.8 kB | |
| AppServer.h | 2023-02-20 | 3.4 kB | |
| client.cpp | 2023-02-20 | 7.0 kB | |
| Makefile | 2023-02-20 | 3.5 kB | |
| TcpClient.cpp | 2023-02-20 | 4.2 kB | |
| TcpSegment.h | 2023-02-20 | 3.7 kB | |
| TimerListener.h | 2023-02-20 | 1.5 kB | |
| AppClient.cpp | 2023-02-20 | 9.7 kB | |
| TcpServer.h | 2023-02-20 | 1.7 kB | |
| Totals: 23 Items | 167.6 kB | 0 | |
C++ Example 6
An incomplete implementation of the TCP state machine. This
implementation is based on UDP sockets and does the TCP connect
and disconnect processing. This demo does *not* implement
TCP's sophisticated transmission capability.
+ Building
----------
NOTE: Smc.jar must be built and installed.
$ make all
+ Executing
-----------
There are two separate applications: server and client. The
server application accepts connections on a specified port. The
client application connections to the server application and
transmits messages at random times. The accepted client
connection also sends messages.
Unix:
1. Open a new shell window.
2. $ cd .../src/examples/C++/EX6
3. $ server <port #>
4. Open a new shell window.
5. $ cd .../src/examples/C++/EX6
6. $ client <hostname> <port #>
where <hostname> is the computer on which the server is
running.
Windows:
1. Open a new DOS command window.
2. C:\> cd ...\src\examples\C++\EX6\Debug\server
3. C:\...\src\examples\C++\EX6> server <port #>
4. Open a new DOS command window.
5. C:\> cd ...\src\examples\C++\EX6\Debug\client
6. C:\...\src\examples\C++\EX6> client <hostname> <port #>
where <hostname> is the computer on which the server is
running.
For both Unix and Windows, you can stop both the server and
client programs by hitting <Cntl-c>. Note: On Windows, the
server and client programs will not receive the interrupt until
select() returns.
Have some fun! Mix and match server and clients running on
different computers of different platform types, even different
programming languages. The server and client executables built
here should run against ../../Java/EX6 server and client classes.