December 2000
Intermediate to advanced
784 pages
20h 54m
English
We will write a client/server pair to illustrate the basics of urgent data. The client connects to the server via TCP and sends a stream of lines containing normal (nonurgent) data, with a small pause between each line. The server reads the lines and prints them to standard output.
The twist is that the client intercepts interrupt key (^C) presses and sends out 1 byte of urgent data containing the character "!". The server retrieves the urgent data when it comes in and prints a warning message to that effect.
We will look at the client first. The urg_send.pl script is listed in Figure 17.2.
Lines 1–6: Set up the socket We create a socket connected to the indicated host ...
Read now
Unlock full access