December 2000
Intermediate to advanced
784 pages
20h 54m
English
We now have all the ingredients on hand to add a useful feature to the UDP chat client developed in Chapter 19. If the client is launched without specifying a target server, it broadcasts requests to the chat port on whatever networks it finds itself attached to. It waits for responses from any chat servers that might be listening, and if a response is forthcoming from a host within a set time, the client connects to it and proceeds as before. In the case of multiple responses, the client binds to whichever server answers first. This is a simple form of resource discovery.
You'll find the code listing for the revised chat client in Figure 20.4. It is derived from the timed chat client of ...
Read now
Unlock full access