I'm seeing that UDP has problems tring to send status back to the phone even when a UDP server is running on both phone and PC using two differemt ports. When using Wifi hot spots where I wouldn't have access to port forwarding it would be impossible to receive on UDP. When I tried TCP I would get errors everytime the connection was lost due to ip change.
I am thinking of a coulple other ideas that might work.
MiniDemonic posted notification server which uses an HTTP client to receive the phones IP address:
HttpReq.InitializeGet("http://automation.whatismyip.com/n09230945.asp") hc.Execute(HttpReq, 1)
Since UDP seems to work good sending from the phone to the PC server, I was thinking I could have the server update a webpage with up-to-date status and I could poll the information from the phone similar to MiniDemonic's httpreq every 5 minitues or so, and after sending commands to verify they were received. I haven't looked into SQL servers yet, but that might also be a good way to try.
I guess if I knew more about TCP I could have a connection that closes without error when IP addresses change and then re-establishes connection. I would think that a constant TCP service connection would drain the phone's battery quicker than an occational httpreq though. Am I wrong in that assumption?
Any comments to help guide me to the best way to achive my goal will be appreciated!
Thanks,
Jim
Hey just a note on UDP vs TCP. In your case TCP is probably the right choice.
The main difference is that UDP is "best effort", its faster but doesn't care if some packets got there or not. Usually used for stuff like video streaming where some image corruption doesn't matter, or in some games to reduce latency.