Solved

Connecting socket to server on Windows Mobile platform

Posted on 2013-10-22
2
470 Views
Last Modified: 2013-10-23
Hi Experts,
We're using Windows Mobile 6.5.  Our application creates a socket and connects to a Telnet server - we interpret the response from the server and send back user input as required.  Whilst the Windows Mobile device stays awake all is fine.
When the device 'sleeps' and is then woken it attempts to open a new port for the socket connection. This is happening at a lower level than my application, and is not the direct result of my coding.  The result is that the host is confused, seeing two ports from the same device and closes both ( understood from a Wireshark trace ).
Can anyone tell me is this behaviour - i.e. opening a new port on wake-up - is 'normal', or can be disabled ?
Thanks
Mart
0
Comment
Question by:MartinHouse
2 Comments
 
LVL 16

Accepted Solution

by:
hjgode earned 500 total points
ID: 39593312
Using sockets before and after suspend/resume depends on the power management settings and setup of the device. If it shuts down the network (WLAN or WWAN) during suspend, you have to close the socket and open a new connection.

You can watch for power notifications using the MS power notification message queue. The app will receive the "device has suspended" message first after the device is resumed! As the same, close and open connection after resume, is true for serial comm too, I can provide a C++ sample for the power message queue: http://code.google.com/p/win-mobile-code/source/browse/trunk/KeyWedge/KeyWedge/PowerMsgQueue.cpp 

Possibly you may want to disable automatic and manual suspend of the device and provide an option to suspend the device from your app. Then you can gracefully close the communication channel.

On the server side you will have to setup the socket to close after some time of inactivity. Otherwise you may run out of communication channels. On the client side you should open and close a comm chanel only as long as you need to transfer data.

The above are general suggestions.

As persisting telnet connections during suspend/resume or WLAN disconnect/connect is a general problm, there are some middel-ware solutions that keep one connection on the telnet server and enable the 'sometimes offline' client to re-use a connection. Intermec provides such a solution named "Session persistence server". There may be other companies providing similar solutions.
0
 
LVL 1

Author Closing Comment

by:MartinHouse
ID: 39593966
Thanks - from your description, I think I need to handle the power down situation
0

Featured Post

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
increase internet speed 3 83
How to block unwanted ads from my S7? 3 59
Network Packet Analyzer Solar Winds 3 75
android app- saved password.. 7 44
For Sennheiser, comfort, quality and security are high priority areas. This paper addresses the security of Bluetooth technology and the supplementary security that Sennheiser’s Contact Center and Office (CC&O) headsets provide.  
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now