Skip to content

Instantly share code, notes, and snippets.

View 0minus273's full-sized avatar

Marina Morozova 0minus273

View GitHub Profile
113 int i = 0;
114 int received = 0;
115 int sizenow = 4096;
116 int sizebefore = sizenow;
117 char *buffer = (char *) malloc(sizenow);
118 char *buf = buffer;
119 while ((received = read(sock, buf, 4096))>0)
120 {
121 i = i + received;
122 sizebefore = sizenow;