|
-
Dec 4th, 2005, 12:24 PM
#1
Thread Starter
New Member
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
-
Dec 5th, 2005, 10:40 AM
#2
Lively Member
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.
-
Dec 6th, 2005, 11:24 AM
#3
New Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|