× 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 think what he is saying is that he wants to make sure the receive
buffer is empty before he sends anything.

If that is the case then select() should work.

Albert

On Thu, Jan 27, 2011 at 3:18 PM, Scott Klement
<midrange-l@xxxxxxxxxxxxxxxx> wrote:
Hello,

I'm not sure that I understand?   Let's see if I do...

You are sending multiple requests:

req = 'COMMAND TO DO SOMETHING';
send(fd, req, len(req));
req = 'COMMAND TO DO SOMETHING';
send(fd, req, len(req));
req = 'COMMAND TO DO SOMETHING';
send(fd, req, len(req));

In this example, 3 requests.  Now you want to get the response from the
3 requests, but you want to make sure you get the response from the last
one?

If so, why not use a counter?  (Keep receiving until you've received the
3rd response.)

I don't understand what this has to do with blocking/non-blocking?



On 1/27/2011 3:24 PM, hockchai Lim wrote:
I've a socket client application that calls the send() api to send some
request data to the sever and then calls the recv() api to receive the
result from it.  A fairly typical socket client program.  But because this
is a critical application, I would like to have a way to ensure that all the
result data that I'm getting from the recv() api calls are for the last very
last send() request that I've just sent out.  So, I'm thinking, I should
call the recv() api in non-blocking mode before I call the send() api to
flush out all the recv() buffer.  Would this be a wise idea?

thanks





--
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 thread ...

Replies:

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.