[Live-devel] Error of the server running in Linux

Ross Finlayson finlayson at live555.com
Mon Oct 11 20:55:59 PDT 2010


>Hello i have solved the problem in linux by applying the variable #define
>READ_FROM_FILES_SYNCHRONOUSLY 1, as by default for windows, within the
>class ByteStreamFileSource.
>Can anyone guess why from the last update in my code, i need this
>modification in order to run properly the server?

Because your code is buggy.  You are closing open files (which are 
also sockets in Linux), without also calling 
"TaskScheduler::turnOffBackgroundReadHandling()" on the socket. 
That's why you're seeing the "Bad file descriptor" error.

Note how the "ByteStreamFileSource" code (when not reading from files 
synchronously) calls "TaskScheduler::turnOnBackgroundReadHandling()" 
whenever it opens a file, and calls 
"TaskScheduler::turnOffBackgroundReadHandling()" whenever it closes a 
file.


>  Does it damage a lot the performance and scalability of the server?

Yes.  Note the comment near the start of "ByteStreamFileSource.cpp".


>  Just remember i am streaming
>H264 sequences divided in multiple video files. When the buffer on the
>server gets empty i use a xml script to decide the next video segment of
>h264 to send and therefore to include in the buffer before.

If you know these multiple file names in advance, then you could use 
"ByteStreamMultiFileSource" (unmodified!) instead.  It allows you to 
read multiple files - one at a time - as if they were a single file.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list