From c980c4fd45f6d716d4cba0673a9658da344c1291 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 8 Nov 2010 01:00:22 +0100 Subject: [PATCH] Nog een poging... --- util/ddv_socket.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/ddv_socket.cpp b/util/ddv_socket.cpp index bc6fe670..595ab2bb 100644 --- a/util/ddv_socket.cpp +++ b/util/ddv_socket.cpp @@ -6,6 +6,7 @@ #include #include +bool socketError = false; int DDV_Listen(int port){ int s = socket(AF_INET, SOCK_STREAM, 0); @@ -36,9 +37,13 @@ int DDV_Accept(int sock){ } bool DDV_write(char * buffer, int width, int count, int sock){ - return (send(sock, buffer, width*count, 0) == width*count); + bool r = (send(sock, buffer, width*count, 0) == width*count); + if (!r){socketError = true} + return r; } bool DDV_read(char * buffer, int width, int count, int sock){ - return (recv(sock, buffer, width*count, 0) == width*count); + bool r = (recv(sock, buffer, width*count, 0) == width*count); + if (!r){socketError = true} + return r; }