|
I've been using 15 seconds regularly and double it to 30 seconds for satellite connections. You should be running with either a block counter or a delimiter. The block counter allows for encryption whereas the delimiter will not. Ken Slaugh (707) 795-1512 x118 Chouinard & Myhre, Inc. AS/400 Professional Administrator/MSE Client Access Specialist http://www.cm-inc.com/ Rich Duzenbury <rduz@westernmid To: mi400@midrange.com range.com> cc: Sent by: Subject: Re: [MI400] what is a reasonable mi400-admin@midr socket select() wait time? ange.com 04/22/2002 12:33 PM Please respond to mi400 > >Why does the select() periodically fail? How can my client truly, TRULY >determine if more data is available from the server? Do I need a non-zero >wait time? What is a reasonable value? I don't think select is 'failing' per se. There just isn't any data -yet-. Lost & retransmitted packets by the underlying transport mechanism could cause this, as another poster mentioned. A busy network might also cause select give up before any data is available. Perhaps I read too much into your message, but I wonder how your actual protocol is setup. The receive side of the socket knows how much data to expect, right? If you send a fixed length message, your read loop should loop until a complete message is read, or an error occurs. If you send a delimited message - e.g. a null byte at the end of each message, your read loop should read until the null is located, or an error occurs Otherwise, you could preface a variable length message with the number of bytes to follow, and then loop until that many bytes are received, or an error occurs. The point is, the receive loop has to *know* how much data to look for. Also, the loop must be prepared to receive a message in 'chunks' or 'pieces' by comparing the received count with the requested count, and acting accordingly by requesting to read the remaining data. _______________________________________________ This is the MI Programming on the AS400 / iSeries (MI400) mailing list To post a message email: MI400@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/mi400 or email: MI400-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/mi400.
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.