| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| Makefile.win | 2023-02-20 | 3.4 kB | |
| TcpConnectionListener.java | 2023-02-20 | 1.7 kB | |
| TcpSegment.java | 2023-02-20 | 9.8 kB | |
| README.txt | 2023-02-20 | 1.3 kB | |
| server.java | 2023-02-20 | 9.2 kB | |
| TcpConnection.sm | 2023-02-20 | 20.3 kB | |
| TcpServer.java | 2023-02-20 | 1.7 kB | |
| TcpServerListener.java | 2023-02-20 | 1.4 kB | |
| TimerListener.java | 2023-02-20 | 1.2 kB | |
| AsyncTimer.java | 2023-02-20 | 7.7 kB | |
| client_manifest.txt | 2023-02-20 | 52 Bytes | |
| Makefile.unix | 2023-02-20 | 3.4 kB | |
| server_manifest.txt | 2023-02-20 | 52 Bytes | |
| TcpClientListener.java | 2023-02-20 | 1.5 kB | |
| AsyncDatagramSocket.java | 2023-02-20 | 6.8 kB | |
| client.java | 2023-02-20 | 11.8 kB | |
| DatagramSocketListener.java | 2023-02-20 | 1.6 kB | |
| Makefile | 2023-02-20 | 8.4 kB | |
| TcpClient.java | 2023-02-20 | 2.5 kB | |
| TcpConnection.java | 2023-02-20 | 25.3 kB | |
| Totals: 20 Items | 119.1 kB | 0 | |
Java Example 6
The TCP/IP protocol state diagram based on UDP. It follows the
TCP/IP connect and disconnect protocol but not the sophisticated
transmission scheme.
+ Building
----------
NOTE: Smc.jar must be built and installed.
Unix & Windows:
$ make tcpdemo
+ 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 & Windows:
$ java -jar server.jar <port>
where <port> is a valid *UDP* port number.
Hit return to terminate the application. This will close all
client connections and all clients will terminate.
$ java -jar client.ajr [-h <host>] -p <port>
where <host> is the host machine running the server
application (may be omitted if client is running
on the same machine).
<port> is the same port number used in starting the
server application.
Hit return to terminate the application. This will close this
client's connection to the server. The server will *not*
terminate.