[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ActiveSync swallows SocketException

Posted on 2008-10-13
1
Medium Priority
?
535 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

IF you are either unfamiliar with rootkits, or want to know more about them, read on ....
This article is about my experience upgrading my consulting machine to Windows 10 Version 1709 (The Fall 2017 Creator Update)
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month20 days, 4 hours left to enroll

873 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