Solved

ActiveSync swallows SocketException

Posted on 2008-10-13
1
530 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
WIndows 7 remote desktop issue 6 85
Extension Change 2 26
sync two window 10 machine 7 51
unwanted partiton on usb drive 8 39
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Suggested Courses

739 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