home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_01_07
/
1n07034b
< prev
next >
Wrap
Text File
|
1990-11-15
|
433b
|
26 lines
LISTING 2
/* routine to read data that is
available on the network descriptor
nd. reads len bytes of data.
*/
#define BUFFSIZE 512
void read_data(int nd)
{
char buffer[BUFFSIZE];
do {
len = net_read(nd,
buffer, BUFFSIZE,
(struct addr *) NULL, 0);
if (len < 0)
pneterror("net_read");
else
write(file, buffer, len);
} while (len >= 0);
}