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

Using the RECV API

We mentioned at the beginning of this chapter that our first example program would be a simple file-transfer application. Having run the previous APIs, we’re in communication with the remote client (which we will develop shortly). We are now ready to find out what file the client wants to download. In the design of our file-transfer program, we expect the client to send us a 10-byte file name. To receive this file name, we call the Receive Data API, RECV. The parameter descriptions for RECV are shown in Figure 15.9.

Figure 15.9. The RECV API.
int recv (int socket_descriptor, char *buffer, int buffer_length;
           int flags)

The RECV API takes four parameters. The first parameter, Socket_descriptor, is the socket descriptor that identifies ...

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