Hi, I've been playing with this problem now for a couple of weeks on and off, and have encountered a few issues that I hoped someone might like to comment on.
When the .Net plugin pulls the .3ds file, mentioned earlier,from the file server, the response to the GET has the file embedded. I've made a number of attempts at implementing a handler within the 3ds plugin to take the istream and treat in a similar manner to that of a file, however I have encountered various issues. The first issue is that the socketstream that comes from the .Net plugin doesn't work when I make calls to the gtell function to try and identify where in the stream I am - I suspect similar problems for the gseek as well. On reflection I'm not too surprised as potentially the stream could be still being downloaded, and to jump to the beginning whilst receiving the stream perhaps is asking a little too much. I therefore looked to implement a new class that took either an istream, or a filename, and read the data into a single buffer, implementing functions similar to read and gtell and gseek, I would then be able to have a single handler for any source of data. However I encountered two issues. 1) The file is 61440 bytes on the file server, but the reponse from the server claims its embedded length is 61441 bytes. I read this in chunks of 1024 bytes, which leaves a final read being executed on a stream with 1 byte left in it. The socketstream doesn't handle this very well, and goes off into space. Essentially it appears to assume that the end of the stream is null terminated, but in this case it isn't. 2. In effort to stream line the code, assuming I could fix (1) I opened the local file scenarios using an ifstream. Throwing this into the stream reading code in (1) the looping reading chunks of 1024 bytes fails after approximately 2048 bytes. One solution I could look at is to strip of the content-length info within the .net pluggin, however this means more changes to osg that I was trying to minimise. Any thoughts ? Neil. _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
