Push Listener

G

Groghz

Hello,

I try to make a push listener for PPC/SP.

On a desktop device, I would simply launch a thread with a TcpListener
and listen to incoming push notifications.

1/ But for a mobile phone, the device ip adress changes very often. Is
it possible to be notified (by an event) when the phone ip adress has
changed ?

Currently I poll the adress of the phone every few seconds to detect
these changes.

2/ I use a TcpListener in a thread that listens on the last detected ip
address on the phone. But when the ip changes, the TcpListener must
restart too. So the former TcpListener must be stopped and a new
TcpListener be created with the right adress. Is there a way to restart
a TcpListener with another adress without destroying it ? How can a
TcpListener be stopped when it's stuck on TcpListener.Accept for
example ?

Is using a TcpListener a bad idea ? Can it be achieve by using the
Socket class ?

thanks in advance
 
C

chris-s

You will find there are many other issues in implementing this type of
connection and the best approach is to setup some form of keep-alive
process whereby the mobile device sends a small packet to the server in
order to prevent the network provider from dropping the connection at
regular intervals. From the tcpconnection you can retreive the sending
IP.

However, using TCP for this keep alive is probably not ideal, it's a
"send and wait for acknowledgement" type of protocol, UDP would be
better for a simple keep alive over a high-latency/high-dropout-risk
network, but requires more coding effort to implement a file transfer
protocol, but you could switch to TCP for data transfer when required.

Chris
 
C

chris-s

I forgot to mention, but I'm sure you may have discovered, the
connections need to be established from the mobile end due to NAT on
the providers network, unless you are using some special/private APN.

Chris
 
G

Guest

We have found using the standard public APN's as provided for sending MMS for
example with most network providers etc is not suitable for businesses. These
GPRS internet APN's are very unreliable and can drop at anytime (even if
sending packets periodically). This of course causes other issues as you have
found with IP address will change frequentally.

What you need (as someone else said) is a private APN which will allow you
to have permanent IP address and often these services support 3G networks
too. Most network providers provide this service; ORANGE, O2, VODAFONE etc.
These networks act as a two way pipe as it is more or less impossible to push
data out to the device using a standard APN because of the NAT (Network
Address Translation) that occurs.

Simon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top