|
Hi Don,Please read the following article "Timeouts with Sockets" for a description of two different ways of timing out the various socket APIs (including recv).
http://www.systeminetwork.com/article.cfm?id=53809That article does require a membership with SystemiNetwork.com, but a free ("Associate") membership should do the trick.
Fisher, Don wrote:
Following Scott Klement's excellent sockets tutorial, I have created a program that will send and receive data to and from a business partner. Since the "recv" sockets command waits indefinitely for data, I tried to use the "setsockopt" command with level -1 (socket) and option name 50 (recv timeout) to change the wait time to one second. I found out through the archives that this is not supported, but strangely enough, it worked on the first day. However, it stopped working the next day. So I guess I have two questions. First, does anyone know why it would work one day and not the next? Second, if I can't change the timeout value, how do I prevent "recv" from waiting forever for data?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.