Click here to Skip to main content
15,924,829 members
Home / Discussions / System Admin
   

System Admin

 
GeneralRe: New OS Pin
Migs18-Nov-01 17:41
Migs18-Nov-01 17:41 
GeneralRe: New OS Pin
Peter Liddle25-Nov-01 2:33
Peter Liddle25-Nov-01 2:33 
GeneralRe: New OS Pin
Migs25-Nov-01 6:12
Migs25-Nov-01 6:12 
GeneralRe: New OS Pin
Nish Nishant25-Nov-01 6:26
sitebuilderNish Nishant25-Nov-01 6:26 
GeneralRe: New OS Pin
Lucky the code machine15-May-02 23:37
Lucky the code machine15-May-02 23:37 
GeneralProgramming Applications for Microsoft Windows,Fouth Edition Pin
flying18-Oct-01 6:09
flying18-Oct-01 6:09 
GeneralRe: Programming Applications for Microsoft Windows,Fouth Edition Pin
peterchen18-Oct-01 6:19
peterchen18-Oct-01 6:19 
GeneralBerkeley sockets Pin
Jon Sagara17-Oct-01 20:23
Jon Sagara17-Oct-01 20:23 
Ok, I'm a bit perplexed with simple concept.

I have a small client/server app. I'm sending <1024 bytes of data from the client to the server with the send() function call. On the server, I read this data with the recv() function call. I assumed that this would "consume" the data, and the next call to recv() from either side would block because there is no more data to get. Well, for some reason, the data remains, and I am confused why.

Here are the steps of the program:

1. Client sends file name to Server with send()
2. Server reads file name with recv()
3. Server tries to open file; if successful, send back "yes" else send back "no" using the send() function.
4. Client calls recv() to find out whether open() was successful.

At this point, if I didn't send the "yes" or "no" back to the Client, I thought the call to recv() on the Client would block because there would be no data to read. However, it reads in the data that it originally sent to the Server (i.e., the filename).

Where am I going wrong here?

I realize this isn't the best solution. I have a better one that works, but I tried this first and the mystery has me perplexed. I didn't post the code because it is lengthy.

Thanks,

Jon Sagara

"Oh Lisa, you and your lies. Bart's a vampire, beer kills brain cells. Let's go back to that building... thingy... where our beds... is."
GeneralRe: Berkeley sockets Pin
Jon Sagara17-Oct-01 21:11
Jon Sagara17-Oct-01 21:11 
GeneralRe: Berkeley sockets Pin
markkuk17-Oct-01 21:38
markkuk17-Oct-01 21:38 
GeneralRe: Berkeley sockets Pin
Jon Sagara18-Oct-01 4:44
Jon Sagara18-Oct-01 4:44 
GeneralRe: Berkeley sockets Pin
markkuk18-Oct-01 20:08
markkuk18-Oct-01 20:08 
GeneralRe: Berkeley sockets Pin
Jon Sagara18-Oct-01 20:16
Jon Sagara18-Oct-01 20:16 
GeneralRe: Berkeley sockets Pin
Jon Sagara18-Oct-01 19:06
Jon Sagara18-Oct-01 19:06 
Questioncrazy idea.............. ? Pin
Huu Quynh9-Oct-01 13:41
Huu Quynh9-Oct-01 13:41 
AnswerRe: crazy idea.............. ? Pin
Rassman30-Oct-01 23:19
Rassman30-Oct-01 23:19 
GeneralIP Port monitor Pin
Leo Smith3-Oct-01 3:57
Leo Smith3-Oct-01 3:57 
GeneralRe: IP Port monitor Pin
NormDroid3-Oct-01 4:25
professionalNormDroid3-Oct-01 4:25 
GeneralRe: IP Port monitor Pin
Leo Smith3-Oct-01 4:43
Leo Smith3-Oct-01 4:43 
GeneralRe: IP Port monitor Pin
NormDroid3-Oct-01 4:53
professionalNormDroid3-Oct-01 4:53 
GeneralRe: IP Port monitor Pin
3-Oct-01 4:39
suss3-Oct-01 4:39 
GeneralRe: IP Port monitor Pin
Lim Bio Liong18-Dec-01 0:17
Lim Bio Liong18-Dec-01 0:17 
GeneralServices & Sockets in NT Pin
Jason Hihn28-Sep-01 4:24
Jason Hihn28-Sep-01 4:24 
GeneralRe: Services & Sockets in NT Pin
Andres Manggini28-Sep-01 7:11
Andres Manggini28-Sep-01 7:11 
GeneralRe: Services & Sockets in NT Pin
6-Nov-01 4:01
suss6-Nov-01 4:01 

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.