I have a Motorola/Symbol terminal running Windows CE 6 connected through a LAN cradle to my network with a static IP address.
The terminal runs a compact framework 2.0 app. When the terminal is put into the cradle, a form is opened which creates a socket and starts listening for incoming data. The inner workings of this socket are modeled after the socket examples on MSDN. When the terminal is not in the cradle, it doesn't have an IP-address, because the network adapter is unbound. When put into the cradle, the adapter appears in the config panel->network screen and I can ping the terminal. If the terminal is removed from the cradle, I close the socket (and subsequently the form)
The socket options I use on the terminal are REUSE ADDRESS, and the LingerOption set to zero.
My desktop (c# .net 3.5) app sends data to the listening socket.
So far so good.
Consider the following scenario:
My desktop app sends 3 files to the terminal. One is 25kb, one 41kb, and the third is 795kb. Under normal circumstances this works fine.
If I however remove the terminal from the cradle and put it in again, and repeat this process several times (so a socket is opened/closed, opened/closed etc) the Socket.Send in my desktop app will hang in between 5 and 10 minutes before returning. When this happens, the terminal won't receive anything.
If I take it out once or twice, there won't be a problem.
I basically want to know why the terminal stops receiving data. I also find it curious however, why the socket.send on my desktop app will eventually return but there is no indication of anything going wrong (the fact aside that it takes very long). Does this perhaps mean that bytes are actually sent, but they are somehow lost on the terminal?
Any help would be greatly appreciated.