From 13ae8307279a7e5015c35b7c92eed03ea1ee8e2d Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 8 Nov 2010 01:00:22 +0100 Subject: [PATCH] Nog een poging... --- Connector_RTMP/main.cpp | 2 +- util/ddv_socket.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Connector_RTMP/main.cpp b/Connector_RTMP/main.cpp index 25cba8e2..0f777071 100644 --- a/Connector_RTMP/main.cpp +++ b/Connector_RTMP/main.cpp @@ -77,7 +77,7 @@ int main(){ - while (!ferror(CONN) && !feof(CONN)){ + while (!socketError){ //only parse input if available or not yet init'ed //rightnow = getNowMS(); retval = epoll_wait(poller, events, 1, 0); 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; }