Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. you can't use strcpy, when writing the bytes, it will stop at the 1st zero byte, (memcpy instead)

  2. 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.

  3. the iplimage to hold the receiving data must be constucted with correct width,height,type. just assigning the data is not enough

  1. 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

  2. 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.

  3. the iplimage to hold the receiving data must be constucted with correct width,height,type. just assigning the data is not enough