Solved

ActiveSync swallows SocketException

Posted on 2008-10-13
1
531 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

707 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