Fix voor afsluiten verbinding...

This commit is contained in:
Thulinma 2010-11-08 02:45:46 +01:00
parent ee3973a8c6
commit c4e1851f42

View file

@ -41,7 +41,7 @@ bool DDV_write(void * buffer, int width, int count, int sock){
int todo = width*count; int todo = width*count;
while (sofar != todo){ while (sofar != todo){
int r = send(sock, (char*)buffer + sofar, todo-sofar, 0); int r = send(sock, (char*)buffer + sofar, todo-sofar, 0);
if (r < 0){ if (r <= 0){
socketError = true; socketError = true;
printf("Could not write! %s\n", strerror(errno)); printf("Could not write! %s\n", strerror(errno));
return false; return false;
@ -56,7 +56,7 @@ bool DDV_read(void * buffer, int width, int count, int sock){
int todo = width*count; int todo = width*count;
while (sofar != todo){ while (sofar != todo){
int r = recv(sock, (char*)buffer + sofar, todo-sofar, 0); int r = recv(sock, (char*)buffer + sofar, todo-sofar, 0);
if (r < 0){ if (r <= 0){
socketError = true; socketError = true;
printf("Could not read! %s\n", strerror(errno)); printf("Could not read! %s\n", strerror(errno));
return false; return false;