1 | initial version |
you can't use strcpy, when writing the bytes, it will stop at the 1st zero byte, (memcpy instead)
when reading back in, be prepared, that your packets will be fragmented into small pieces, so you can't read it all in one go. check how many bytes you read, and repeat till done.
the iplimage to hold the receiving data must be constucted with correct width,height,type. just assigning the data is not enough
2 | No.2 Revision |
you can't use strcpy, strcpy (or strlen), when writing the bytes, it will stop at the 1st zero byte, (memcpy instead)byte.
use memcpy instead, img.width * img.height * img.nChannels() for the counting
when reading back in, be prepared, that your packets will be fragmented into small pieces, so you can't read it all in one go. check how many bytes you read, and repeat till done.
the iplimage to hold the receiving data must be constucted with correct width,height,type. just assigning the data is not enough