Click here to Skip to main content
16,012,082 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: title text on the main frame Pin
Christian Graus23-Feb-01 22:23
protectorChristian Graus23-Feb-01 22:23 
Generalcreate an exe file from another Pin
Sachin23-Feb-01 15:01
Sachin23-Feb-01 15:01 
GeneralRe: create an exe file from another Pin
Tim Deveaux24-Feb-01 4:14
Tim Deveaux24-Feb-01 4:14 
QuestionHow to install source patch with VC++? Pin
23-Feb-01 13:09
suss23-Feb-01 13:09 
QuestionHow to install source patch with VC++? Pin
23-Feb-01 13:08
suss23-Feb-01 13:08 
GeneralWinsock problem - PLEASE help Pin
23-Feb-01 11:11
suss23-Feb-01 11:11 
GeneralRe: Winsock problem - PLEASE help Pin
Tim Deveaux23-Feb-01 13:06
Tim Deveaux23-Feb-01 13:06 
GeneralRe: Winsock problem - PLEASE help Pin
James R. Twine27-Feb-01 8:14
James R. Twine27-Feb-01 8:14 
> the problem is this: if i DONT limit the data to about 1kb at a time,
> then the data does NOT get transferred correctly over the internet

How does it not get transferred correctly? TCP/IP will let you transfer > 1KB in a single call, but there is no guarantee that the corresponding receive call will get all of the data in one shot.

For example, you can send a 4KB chunk in a single send(...) call, but the receive(...) on the other side may return with only 2KB copied into the buffer. This is normal. You need to break up your data into packets, and then keep track of the packets as they are received so that you can coalesce them if they get fragmented.

One way to do this is to send packets that are always of a fixed size. This is a bit ineffecient for the last packet, if it contains data that is less that that size, but it allows you to know when you have a full packet on the other side. (You need to embed the size of the data within the packet.)

Other way is to design a packet that contains a header that includes a signature, and the side of the packet (including the header). That way, the receive side can keep calling receive(...) until it has a complete packet, and then process the packet.


-=- James.
QuestionSounds ?? Pin
23-Feb-01 8:39
suss23-Feb-01 8:39 
AnswerRe: Sounds ?? Pin
Christian Graus23-Feb-01 22:29
protectorChristian Graus23-Feb-01 22:29 
AnswerRe: Sounds ?? Pin
23-Feb-01 23:34
suss23-Feb-01 23:34 
GeneralAFX Woes Pin
Jamie Nordmeyer23-Feb-01 6:22
Jamie Nordmeyer23-Feb-01 6:22 
GeneralRe: AFX Woes Pin
Tim Deveaux23-Feb-01 7:46
Tim Deveaux23-Feb-01 7:46 
GeneralEncoding Ascii file Pin
Gerry23-Feb-01 5:46
Gerry23-Feb-01 5:46 
GeneralRe: Encoding Ascii file Pin
Daniel Ferguson23-Feb-01 7:13
Daniel Ferguson23-Feb-01 7:13 
GeneralRe: Encoding Ascii file Pin
23-Feb-01 9:52
suss23-Feb-01 9:52 
GeneralSeeking Patterns in Files Pin
23-Feb-01 3:49
suss23-Feb-01 3:49 
GeneralRe: Seeking Patterns in Files Pin
l a u r e n23-Feb-01 3:57
l a u r e n23-Feb-01 3:57 
GeneralMultiple child frames for a document Pin
23-Feb-01 2:53
suss23-Feb-01 2:53 
GeneralRe: Multiple child frames for a document Pin
l a u r e n23-Feb-01 3:48
l a u r e n23-Feb-01 3:48 
QuestionHow to detect a IE 5 or 5.5 url request Pin
23-Feb-01 2:06
suss23-Feb-01 2:06 
AnswerRe: How to detect a IE 5 or 5.5 url request Pin
Michael Dunn23-Feb-01 15:55
sitebuilderMichael Dunn23-Feb-01 15:55 
QuestionHow to execute code before shutdown? Pin
23-Feb-01 0:35
suss23-Feb-01 0:35 
AnswerRe: How to execute code before shutdown? Pin
23-Feb-01 1:02
suss23-Feb-01 1:02 
GeneralProcess injected DLLS Pin
Traveler22-Feb-01 21:17
Traveler22-Feb-01 21:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.