From: Harry Date: 2006-05-26T17:22:23+09:00 Subject: Re: How to get bitmap file via ethernet On 5/26/06, Ryan Leavengood wrote: > >In my experience when you are reading binary data from a > socket there is usually a length indicator at the beginning to tell > you how much to read. So for example you would read 4 bytes and then > use String#unpack to turn those bytes into a length, which would be > how much you would read next for the rest of the data. > > len = image_io.read(4).unpack('N')[0] > img = image_io.read(len) > > That was it. At the beginning of the data was the length indicator (and some other data). Thanks to you, I was able to capture the image data before the end of the day Friday and can get on with my code next week. Thank you.