Solved

ActiveSync swallows SocketException

Posted on 2008-10-13
1
528 Views
Last Modified: 2013-12-21
Hi all,

I'm experiencing unexpected behaviour from ActiveSync, when establishing socket connections with a Windows Mobile 6 Classic emulator.

When the emulator is not cradled (and thus not connected to ActiveSync), System.Net.Sockets.Socket.Connect() properly throws a SocketException, when I try to connect to non existant IP/port combinations.

When the emulator is cradled (and connected to ActiveSync) however, I can connect to arbitrary IP/port combinations, without getting a SocketException.

Can this be fixed? I need the SocketException, to reliably check wether a server is available or not.

The development environment is:
Windows XP Professional SP3
Visual Studio 2008 SP1
.NET Compact Framework 3.5 SP1
Windows Mobile 6 Classic Emulator
Device Emulator Manager 9.0
ActiveSync 4.5

string host = "some valid ip or hostname";
string port = "some valid port";
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
var ip = Dns.GetHostEntry(host).AddressList.First();
var ipendpoint = new IPEndPoint(ip, Convert.ToInt32(port));
socket.Connect(ipendpoint);

Open in new window

0
Comment
Question by:justanoob
1 Comment
 
LVL 1

Accepted Solution

by:
justanoob earned 0 total points
ID: 22719349
I solved my problem. Not with the emulator though. I just discovered that the socket connections work fine with a cradled device, just not with a cradled emulator.

The cradled device is what I really need though. I didn't expect different behaviour on that side, so I assumed if the emulator fails, the device must fail likewise.

Jan
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

792 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