diff --git a/src/udpipe_threads.cpp b/src/udpipe_threads.cpp index 3d95e96..59ec5a5 100644 --- a/src/udpipe_threads.cpp +++ b/src/udpipe_threads.cpp @@ -435,22 +435,20 @@ void* senddata(void* _args) while (1) { - bytes_read = read(fileno(stdin), outdata, BUFF_SIZE); int ssize = 0; int ss; - if(bytes_read == 0) { + bytes_read = read(fileno(stdin), outdata, BUFF_SIZE); - // fprintf(stderr, "Transfer complete\n"); - - // sleep (1); + if (bytes_read < 0){ + fprintf(stderr, "[udpipe_threads] unable to read from stdin\n"); + exit(1); + } - //UDT::close(client); - //UDT::close(*args->usocket); + if(bytes_read == 0) { return NULL; - //exit(0); }