An API for Internet Auctions
By Kevin O'Malley and Terence Kelly
Dr. Dobb's Journal September 1998
<b>(a)</b> if ((SetupConnection(servname, port, sd)) < 0) { (void)printf("error on SetupConnection()\n"); exit(EXIT_FAILURE); } <b>(b)</b> nBytes = WriteAPIString(sd, (char *)s, strlen(s)); if (nBytes == 0) { (void)printf("WriteAPIString returned 0 bytes, calling exit\n"); exit(EXIT_FAILURE); } <b>(c)</b> nBytes = ReadAPIString(sd, recvbuf, MAX_API_STRING_LEN); if (nBytes == 0) { (void)printf("ReadAPIString returned 0 bytes, calling exit\n"); exit(EXIT_FAILURE); }
Example 2: Example calls for (a) SetupConnection; (b) WriteAPIString; (c) ReadAPIString.
Copyright © 1998, Dr. Dobb's Journal