Click here to Skip to main content
15,913,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: gracefully kill a process Pin
Jim Crafton21-Feb-07 13:45
Jim Crafton21-Feb-07 13:45 
QuestionRe: gracefully kill a process Pin
David Crow21-Feb-07 6:03
David Crow21-Feb-07 6:03 
AnswerRe: gracefully kill a process Pin
Jim Crafton21-Feb-07 13:46
Jim Crafton21-Feb-07 13:46 
GeneralRe: gracefully kill a process [modified] Pin
Jeroen Walter21-Feb-07 21:28
Jeroen Walter21-Feb-07 21:28 
QuestionRe: gracefully kill a process Pin
David Crow22-Feb-07 2:25
David Crow22-Feb-07 2:25 
AnswerRe: gracefully kill a process Pin
Jim Crafton22-Feb-07 3:28
Jim Crafton22-Feb-07 3:28 
GeneralRe: gracefully kill a process Pin
David Crow22-Feb-07 5:54
David Crow22-Feb-07 5:54 
Questionrecvfrom with less than available bytes Pin
Dave_21-Feb-07 4:02
Dave_21-Feb-07 4:02 
I am curious about a situation I have run into. I am hacking a program that was originally meant to read/write serially (serial port) into using UDP. I'm trying to preserve as much of the original code as possible for reasons that I won't bother you with here.

The situation is that a ReadCom() function is called with a specific number of bytes that the calling function wants. For example, when the buffer to be read from has 22 bytes in it, the ReadCom() may be called asking for only 16 bytes. Another ReadCom() will be called later asking for the remainder.

When I replace the serial port reads with a recvfrom(), it looks like the entire UDP message is gone after the first read even though I only asked for a partial number of bytes.
I have two people here telling me different things. One says this should not happen - it is a FIFO, another saying that any time a recvfrom call is made, the entire UDP packet is cleared.
Which is it? The behaviour seems to match with it being cleared but I would like to know what you think.

BTW - I have tried using the ioctl with FNIOREAD to see how many bytes are available and it does say that 0 are available on the second read.
AnswerRe: recvfrom with less than available bytes Pin
James R. Twine21-Feb-07 7:05
James R. Twine21-Feb-07 7:05 
GeneralRe: recvfrom with less than available bytes Pin
Dave_21-Feb-07 9:59
Dave_21-Feb-07 9:59 
AnswerRe: recvfrom with less than available bytes Pin
Mark Salsbery21-Feb-07 8:25
Mark Salsbery21-Feb-07 8:25 
GeneralRe: recvfrom with less than available bytes Pin
James R. Twine21-Feb-07 8:38
James R. Twine21-Feb-07 8:38 
GeneralRe: recvfrom with less than available bytes Pin
Mark Salsbery21-Feb-07 8:53
Mark Salsbery21-Feb-07 8:53 
Questioncoding 0f this output Pin
bushxee21-Feb-07 3:51
bushxee21-Feb-07 3:51 
AnswerRe: coding 0f this output Pin
toxcct21-Feb-07 3:56
toxcct21-Feb-07 3:56 
GeneralRe: coding 0f this output Pin
Newbie0021-Feb-07 4:13
Newbie0021-Feb-07 4:13 
GeneralRe: coding 0f this output Pin
bushxee21-Feb-07 4:46
bushxee21-Feb-07 4:46 
GeneralRe: coding 0f this output Pin
toxcct21-Feb-07 4:48
toxcct21-Feb-07 4:48 
GeneralRe: coding 0f this output Pin
bushxee21-Feb-07 4:39
bushxee21-Feb-07 4:39 
GeneralRe: coding 0f this output Pin
toxcct21-Feb-07 4:44
toxcct21-Feb-07 4:44 
GeneralRe: coding 0f this output Pin
ThatsAlok21-Feb-07 5:54
ThatsAlok21-Feb-07 5:54 
GeneralRe: coding 0f this output Pin
toxcct21-Feb-07 5:57
toxcct21-Feb-07 5:57 
GeneralRe: coding 0f this output Pin
Hamid_RT21-Feb-07 5:48
Hamid_RT21-Feb-07 5:48 
GeneralRe: coding 0f this output Pin
ThatsAlok21-Feb-07 5:54
ThatsAlok21-Feb-07 5:54 
JokeRe: coding 0f this output Pin
James R. Twine21-Feb-07 6:57
James R. Twine21-Feb-07 6:57 

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.