User`s guide
12
K
A
DAK
KwikNet Overview
Your App-Task can interact with KwikNet using the UDP or IP programming interface or
the TCP or UDP socket services.
At times, KwikNet will be forced to suspend your App-Task pending completion of a
requested service. How this is done depends on the magic of the KwikNet OS interface
which ensures that the KwikNet Task continues to service the TCP/IP stack while waiting
for the event of interest. Execution continues in the KwikNet domain until the service
completes and KwikNet returns to the App-Task in the user domain.
If your App-Task makes requests for non-blocking data transfers across high speed
Ethernet networks, it must increase the frequency at which it yields to the KwikNet Task in
order to achieve optimum network performance.
The Single Threaded Server Queue
In a single threaded system, the KwikNet Task maintains a server queue to support the
optional KwikNet components such as the FTP Server or Web Server. The KwikNet Task
periodically executes each of the servers on its server queue, thereby letting these servers
operate much as they would in a multitasking system.
Your application can append its own servers to the KwikNet server queue, adding a very
primitive form of non-preemptive multitasking to an otherwise single threaded system.
The KwikNet TCP/IP Sample Program illustrates the process. The App-Task calls
procedure kn_addserver() to add a TCP server to the KwikNet Task server queue. The
App-Task then acts as a client using TCP to communicate with the server. When the
sample is finished, the TCP server removes itself from the server queue.
Procedure kn_addserver() is included in the KwikNet Library and is described in
Chapter 4.6.