Q: sending images over a network?
I am working on a program about motion detection that a server side appl captures images when motion detected then it sends these pictures to a client appl.. I know that Winsocket is used for sending text but I dont know how to send images over the net!
c++ code if possible
Re: Q: sending images over a network?
It's not going to be much different from sending text. Just send the actual file data instead. Remember, you may need to send a length notification so that the client knows when it's received all the file.
Re: Q: sending images over a network?
you need to break up the file, then send segments, recompile them at the other end, pretty easy.
just open the picture for binary, and make a loop 1 to lof(filenumber) divide it into 1 kb segments, add a header and footer for each segment, an overall checksum and length.
Client>Serv "About to send file"
Serv>Client "Start Sending"
Client>Serv "Length, Checksum"
Client>Serv "BOF"
Client>Serv "SegmentNumber,Header:(Data),length"
Serv>Client "Confirm SegmentnumberX, SegmentX Length"
If it doesnt match the buffer, resend
loop till end
Client>Serv "EOF"
Serv>Client "File Checksum Ok, Length Ok"
End communication