|
Do you have control over what the server is sending? If so, I would add an "end of line" code to indicate that you have received the entire response. For example: Response1aResponse1bDONE Other than that you could add a timeout on the SELECT() statement. It sounds like the server is not sending everything at once. So the time between responses could be dependent upon how busy the server is. Albert York -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [SMTP:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Brad Stone Sent: Tuesday, August 10, 2004 4:59 PM To: Midrange Systems Technical Discussion Subject: Odd Sockets Problem... I'm playing around with sockets again and having some odd responses from the server I'm speaking with. Sometimes when I send a request, I get a response, but not all of it... So it should be: Me: Command1 Server: Response1a Response1b Response1.... Me Command2 Server Response2 In some cases this works, in other cases it doesn't. Sometimes I get: Me: Command1 Server: Response1a Me: Command2 Server: Response1b And from there the responses are all messed up and my app gets "confused" as to what it should be doing... I am using select() before each read(). I've debugged it and in the cases where I don't get "all the responses" on one read, if I do another read it gets the rest just fine. But, two problems with that: 1. I never know if I got "all reponses" or not.. there could be 1 or more responses. 2. I don't know ahead of time the responses I should get. Any ideas why it wouldn't be sending the entire response in one read() all the time, only part of the time? I check RC, and the buffer length is much larger than the data returned. Wacky stuff. :) Brad -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.