Re: RAS connection and Socket status



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








.



Relevant Pages

  • Re: Can I implement a timer within a thread without a blocking wait?
    ... I think that a periodically running process may consume more server ... I'm trying to implement a multithread server program on Linux. ... I'll close the connection. ... But I can't implement timer signal handler for each thread. ...
    (comp.programming.threads)
  • Re: Can I implement a timer within a thread without a blocking wait?
    ... I'll close the connection. ... But I can't implement timer signal handler for each thread. ... When you want to timeout a connection, add a timer to the linked ... Also clear the flag anytime the connection is active. ...
    (comp.programming.threads)
  • Re: IBM 4247 printing problem
    ... My suggestion is to change the PSFCFG release timer value from *NOMAX ... The reason is that the connection from your IBM server to the printer ... so long as the print writer is started. ...
    (comp.sys.ibm.as400.misc)
  • Re: Close Reader or not?
    ... Would this be for both the Reader and the Connection? ... My problem is that I am running this from a Windows Service with a timer ... Poller never finishes. ...
    (microsoft.public.dotnet.framework.adonet)
  • Help checking a TCP/IP socket connection
    ... Attempt a recv() from the target with the MSG_PEEK flag set. ... If recvreturns -1 and errno is set to EWOULDBLOCK we return true. ... This suggests that the connection to the target has been lost. ...
    (comp.unix.tru64)