| 1 |
Examples |
| 2 |
======== |
| 3 |
|
| 4 |
This directory contains several example that use the TCPSocketAgent's directly from TCL and also examples that show how this socket API can be used from your own NS-2 applications. |
| 5 |
|
| 6 |
socketsfromapp.tcl |
| 7 |
================== |
| 8 |
|
| 9 |
This is a simple example that uses the TCPSocketAgent and TCPServerSocketAgent directly in order to make a simple connection from the client to the server. This example uses FullTCP. |
| 10 |
|
| 11 |
multiplesocketagent.tcl |
| 12 |
======================= |
| 13 |
|
| 14 |
This is a more complex example that uses the TCPSocketAgent and TCPServerSocketAgent directly in order to make a connection from two clients to one server. This is meant to demonstrate the multiple connection caability the TCP server. This example also uses FullTCP. |
| 15 |
|
| 16 |
|
| 17 |
socketagent.tcl |
| 18 |
=============== |
| 19 |
|
| 20 |
This is a complex example that shows how a programmer would build their own agents that used the TCPSocketAgent's API in order to dynamically create sockets and connections in Ns-2. The example given here shows multiple clients (user configurable) that all connection to a single TCPSocketServerAgent to send messages. This example can be expanded easily to create other types of applications that use multiple connections |
| 21 |
|
| 22 |
|
| 23 |
The code in this example forms the basis for the Protolib integration and Java bindings that are described in the examples in the protolib/ns directory and AgentJ's tclscript directory. |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|