Any ideas? I know in the KB there is an article on using SetTimer and
KillTimer for CSocket, but SetTimer and KillTimer are members of CWnd.
Also, does anyone know if ::connect and ::recv block internally until
data is ready or a connection is made?
Any help is appreciated,
Tony
The API versions of ::SetTimer() and ::KillTimer() can be used without a
window. If you use CSocket, the functions will block by default (although
you may be able to switch this off). CAsyncSocket (which is perfectly
usable) does not.
If you call Connect(), it will eventually timeout (without the need for
timers) and the OnConnect() method will fire with an error code. The timeout
isn't that long.
Does this help?
_ _
o o Jason Teagle
<
v jte...@solartron.com
Please ONLY respond via e-mail if you want to catch my attention - I don't
necessarily look at the newsgroups all the time.
If your socket works in blocking mode you can implement a timeout control
using the ::select function. This is the right way.
I have some samples here if you need
Calixto
(Brazil)
MS
On Mon, 28 Sep 1998 18:06:00 -0400, "Tony Garcia" <ton...@isint.net>
wrote:
The nonblocking socket works if the IP points to a machine that is up, and the
port is set to listen() but no one is doing accept().
In article <OBjTW5$69GA...@uppssnewspub04.moswest.msn.net>,
"Eduardo Calixto" <ecal...@ibm.net> wrote:
> Hello Tony,
>
> If your socket works in blocking mode you can implement a timeout control
> using the ::select function. This is the right way.
> I have some samples here if you need
>
> Calixto
> (Brazil)
>
> Tony Garcia wrote in message ...
> > What's the best way to implement a connect or read timeout in my
> winsock
> >wrapper class? I've noticed that online help says the BSD socket option
> for
> >timeouts is not available.. so obviously I have to do my own.
> >
> > Any ideas? I know in the KB there is an article on using SetTimer and
> >KillTimer for CSocket, but SetTimer and KillTimer are members of CWnd.
> >
> > Also, does anyone know if ::connect and ::recv block internally until
> >data is ready or a connection is made?
> >
> >Any help is appreciated,
> >
> >Tony
> >
> >
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own