Solved

ActiveSync swallows SocketException

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The use of stolen credentials is a hot commodity this year allowing threat actors to move laterally within the network in order to avoid breach detection.
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
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.
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…

762 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

18 Experts available now in Live!

Get 1:1 Help Now