Click here to Skip to main content
16,006,535 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Help Pin
David Crow19-Oct-06 4:24
David Crow19-Oct-06 4:24 
QuestionTCP receive 2 Pin
Archyami18-Oct-06 18:39
Archyami18-Oct-06 18:39 
AnswerRe: TCP receive 2 Pin
mpk197918-Oct-06 20:34
mpk197918-Oct-06 20:34 
GeneralRe: TCP receive 2 Pin
Archyami18-Oct-06 20:43
Archyami18-Oct-06 20:43 
AnswerRe: TCP receive 2 Pin
Mark Salsbery19-Oct-06 5:51
Mark Salsbery19-Oct-06 5:51 
GeneralRe: TCP receive 2 Pin
Archyami19-Oct-06 15:35
Archyami19-Oct-06 15:35 
GeneralRe: TCP receive 2 [modified] Pin
Mark Salsbery19-Oct-06 16:26
Mark Salsbery19-Oct-06 16:26 
GeneralRe: TCP receive 2 Pin
Archyami20-Oct-06 6:00
Archyami20-Oct-06 6:00 
I modified the server "send" with data length +1.
The exception does not occur.
Thanks very much, Mark!

I have a few questions:
1. The message eg. equals "abc". Its length is 3.
Why should I send its length as 4?
(The server is checked to send data within the length of CATOS_BUFFER_SIZE.)

2. The recv buffer is allocated with 1 more byte for safe (may be it is a risk...)
My design is that if CATOS_BUFFER_SIZE==10 and message comes from the server as "1234567890", it can hold the message. Indeed, a terminator is at the end (here is '0'). If '\0' is padded by the server, it can still hold the message.
'\0' is padded automatically for initializing an char array.
Please advise if my analysis is wrong.

3. If the server is checked to send data within the length of CATOS_BUFFER_SIZE, is it possible that the client recv() may receive the message sereral times instead of once?
I mean: recv() holds the application (thread). 'several times' refers to 1 recv() receives a part of the message, several recv() receives all message 'packages'.

Please advise. Smile | :)



GeneralRe: TCP receive 2 Pin
Mark Salsbery20-Oct-06 10:08
Mark Salsbery20-Oct-06 10:08 
QuestionHow to add a worksheet in excel Pin
Abhiyantara18-Oct-06 17:32
Abhiyantara18-Oct-06 17:32 
AnswerRe: How to add a worksheet in excel Pin
Hamid_RT18-Oct-06 18:17
Hamid_RT18-Oct-06 18:17 
Questionproblem with atl new wizard Pin
With_problem18-Oct-06 17:16
With_problem18-Oct-06 17:16 
AnswerRe: problem with atl new wizard Pin
Hamid_RT18-Oct-06 18:21
Hamid_RT18-Oct-06 18:21 
QuestionRe: problem with atl new wizard Pin
David Crow19-Oct-06 4:27
David Crow19-Oct-06 4:27 
Questionclass which has no .cpp and .h Pin
gentleguy18-Oct-06 16:29
gentleguy18-Oct-06 16:29 
AnswerRe: class which has no .cpp and .h Pin
Waldermort18-Oct-06 18:57
Waldermort18-Oct-06 18:57 
AnswerRe: class which has no .cpp and .h Pin
Hamid_RT18-Oct-06 19:27
Hamid_RT18-Oct-06 19:27 
AnswerRe: class which has no .cpp and .h Pin
David Crow19-Oct-06 4:28
David Crow19-Oct-06 4:28 
GeneralRe: class which has no .cpp and .h Pin
David Crow19-Oct-06 4:52
David Crow19-Oct-06 4:52 
GeneralRe: class which has no .cpp and .h Pin
Jonathan [Darka]19-Oct-06 4:53
professionalJonathan [Darka]19-Oct-06 4:53 
AnswerRe: class which has no .cpp and .h Pin
Jonathan [Darka]19-Oct-06 4:54
professionalJonathan [Darka]19-Oct-06 4:54 
QuestionCListCtrl dissapearing image Pin
P1P3R18-Oct-06 13:21
P1P3R18-Oct-06 13:21 
AnswerRe: CListCtrl dissapearing image Pin
Mark Salsbery18-Oct-06 14:06
Mark Salsbery18-Oct-06 14:06 
GeneralRe: CListCtrl dissapearing image Pin
P1P3R19-Oct-06 6:04
P1P3R19-Oct-06 6:04 
AnswerRe: CListCtrl dissapearing image Pin
Michael Dunn18-Oct-06 16:17
sitebuilderMichael Dunn18-Oct-06 16: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.