× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.