Re: Power off - detection/handling




You can detect it, but your handler code will likely only happen after wake.
You might have enough time to run 1 or 2 lines of code, but that's a might.
The amount will vary from run to run, so it's not reliable.

So this is a similar situation to what occurs if the device powers
itself down.

The application scenario I am trying to exist with is that my
application has a socket connection to another system. After powerdown
that connection is seemingly unusable (there is a socket exception about
trying to use something to that is not a socket). So I would assume
that if I did a socket.close on that same connection I would fail as
well.

Meanwhile, the server application seems to think that the connection
still exists so I need to be able to reinstate the PPC side's socket
comms or clean up on the server side.

I deal with the PPC turning itself off by using a timer that I reset
whenever there is activity and if there is no activity I do a socket
close and reconnect when there is a requirement for more activity. This
needs to be improved some as I need to determine that there is in fact a
wireless connection before doing the reconnect but that is another
problem.

Is the situation where my socket becomes unusable after a
powerdown/powerup the normal situation or am I missing something?

As a supplementary question related to powerdown. If I run my
application simulating the network traffic via a timer (for load
testing) it seems that the powerdown due to the device not being used
occurs. What defines 'not being used'?


thanks

.



Relevant Pages

  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #3]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... kernel socket family. ... presentation side is left to the client. ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #2]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • Re: Socket Exception
    ... In this case the server most likely rejected your ... connection. ... Each command is a new socket connection that is opened and closed ... /// Required designer variable. ...
    (microsoft.public.win32.programmer.networks)
  • Re: attn:MVPs
    ... winsock dll to the managed .net environment. ... I have an asynchronous TCP socket that listens for data from ... The Slave should not initiate any connection requests/ send other messages ... EXCEPT the acknowledgement for the incoming messages from master, ...
    (microsoft.public.dotnet.framework)

Quantcast