Fix voor xinetd problemen?

This commit is contained in:
Thulinma 2010-11-04 22:08:33 +01:00
parent 309f727f62
commit ceeef9b29e
4 changed files with 4 additions and 6 deletions

View file

@ -47,7 +47,7 @@ int main( int argc, char * argv[] ) {
unsigned char packtype;
bool gotVideoInfo = false;
bool gotAudioInfo = false;
while(std::cin.good()) {
while(std::cin.good() && std::cout.good()) {
loopcount ++;
//invalidate the current buffer
ringbuf[current_buffer]->number = -1;

View file

@ -16,9 +16,8 @@ int main() {
// do something with mySocket...
while( std::cin >> input && input != "") {}
std::cout << "HTTP/1.1 200 OK\nConnection: close\nContent-Type: video/x-flv\n\n";
while(true) {
while(std::cout.good()) {
msg = mySocket.recv(&buffer[0],10000);
if (!std::cout.good()) { exit(0); }
std::cout.write(buffer,msg);
}
// disconnect

View file

@ -15,9 +15,8 @@ int main() {
mySocket.connect(input);
char buffer[500000];
int msg;
while(true) {
while(std::cout.good()) {
msg = mySocket.recv(&buffer[0],10000);
if (!std::cout.good()) {exit(0);}
std::cout.write(buffer,msg);
}
// disconnect

View file

@ -53,7 +53,7 @@ int main(){
#ifdef DEBUG
fprintf(stderr, "Starting processing...\n");
#endif
while (!feof(stdin)){
while (!feof(stdin) && std::cout.good()){
//select(1, &pollset, 0, 0, &timeout);
//only parse input from stdin if available or not yet init'ed
//FD_ISSET(0, &pollset) || //NOTE: Polling does not work? WHY?!? WHY DAMN IT?!?