User`s guide
KwikNet Overview
K
A
DAK
29
Startup
The manner in which the KwikNet TCP/IP Sample Program starts and operates is
completely dependent upon the underlying operating system with which KwikNet is being
used. All sample programs provided with KwikNet and its optional components share a
common implementation methodology which is described in Appendix E. Both
multitasking and single threaded operation are described in detail.
When used with AMX, the sample program operates as follows. AMX is launched from
the main() program. Restart Procedure rrproc() starts a print task. A low priority
background task is also started to simulate clock interrupts in the absence of a hardware
clock. The Restart Procedure then calls application function app_prep() which creates
and starts the client and server tasks.
Once the AMX initialization is complete, the high priority print task executes and waits
for the arrival of AMX messages in its private mailbox. Each AMX message includes a
pointer to a log buffer containing a KwikNet message to be recorded.
Once the print task is ready and waiting, the server task starts and waits for a signal from
the client task. Then the client task finally begins to execute. It starts KwikNet at its entry
point kn_enter(). KwikNet self starts and forces the KwikNet Task to execute. Because
the KwikNet Task operates at a priority above all tasks which use its services, it
temporarily preempts the client task. The KwikNet Task initializes the network and its
associated loopback driver and prepares the IP and TCP protocol stacks for use by the
sample program.
Once the KwikNet initialization is complete, the client resumes execution, signals the
server to resume execution and begins the first of two scenarios.