Fix voor afsluiten verbinding...
This commit is contained in:
parent
ee3973a8c6
commit
c4e1851f42
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue