O'Reilly logo

APIs at Work, Second Edition by Ron Hawkins, Doug Pence, Bruce Vining

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Receiving Data without Waiting

Most commercial applications expect to receive some input data, process that data, and then return the results. Our examples have involved this type of application. As mentioned earlier in this chapter, the RECV API, by default, will not return control until at least one byte of data becomes available to the application or, with the MSG_WAITALL flag, until some fixed minimum amount of data becomes available. This behavior of the RECV API was quite sufficient for our needs.

Some applications, however, might not want to wait for data to become available from a given client (or from a server, for that matter). One example, building on the FIG15_45 client application, might be where the client wants library information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required