Re: RAS connection and Socket status
- From: "Yaroslav Goncharov" <yaroslav@xxxxxxxxxxx>
- Date: Mon, 24 Apr 2006 13:04:48 +0400
You don't need a timer to check the current RAS status. You can specify a
window handle and all notifications will be sent to this window. Make sure
that you don't do any blocking calls from your message pump thread (e. g.
recv) to ensure that status messages can be processed.
You can set a socket operation timeout in the "select" function.
--
Yaroslav Goncharov
Spb Software House, http://spbsoftwarehouse.com
Pocket PC Developer Network, http://pocketpcdn.com
"Stefano Peduzzi" <peste@xxxxxxxxxxxx> wrote in message
news:uXj8Ny$YGHA.4836@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I'm trying it but I'm facing 2 problems:
- I'm starting the RAS connection with RasDial in async mode inside a
timer but I don't get any WM_RASDIALEVENT event. I can only use
RasGetConnectStatus to check it during the connection process
- After having established the connection I've 2 timers: the first every
10 sec check the connection status, the second every 2 sec fetch data with
recv. When the network cable is disconnected the app "freeze" in the recv
for more then 30 secs... so the timer that check the connection status is
unuseful! Which other options do I have? Is it possible to set a timeout
for the recv? I've done some search but did not come out with a clear
answer.
Thanks for your help,
Stefano
"Yaroslav Goncharov" <yaroslav@xxxxxxxxxxx> ha scritto nel messaggio
news:eAcj2m8YGHA.508@xxxxxxxxxxxxxxxxxxxxxxx
Did you try to listen for RAS notifications? Take a look at RASCONNSTATE
documentation for details.
--
Yaroslav Goncharov
Spb Software House, http://spbsoftwarehouse.com
Pocket PC Developer Network, http://pocketpcdn.com
"Stefano Peduzzi" <peste@xxxxxxxxxxxx> wrote in message
news:um8bj7vYGHA.4580@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I'm developing an eVC application that start a connection through serial
port to a device, open a Socket to a server on the device and start a
loop of send and recv commands.
I want to detect when the cable that connect the PPC to the device is
unplugged. Up to now I've set some check on the send and recv commands
and when the cable is unplugged I get first an error on the recv command
and then on the send (it seems that the first send after the unplug
don't rise an error).
As this freeze the PPC for some seconds I would like to find a way to
monitor the RAS (or socket) status.... any idea?
Thanks,
Stefano
.
- References:
- RAS connection and Socket status
- From: Stefano Peduzzi
- Re: RAS connection and Socket status
- From: Yaroslav Goncharov
- Re: RAS connection and Socket status
- From: Stefano Peduzzi
- RAS connection and Socket status
- Prev by Date: RE: Help Shortcut in INF File
- Next by Date: RE: How can I speed up this app <w/ code>
- Previous by thread: Re: RAS connection and Socket status
- Next by thread: Raw IrDA transmission speed
- Index(es):
Relevant Pages
|