views:

121

answers:

2

I need to broadcast an event that can be picked up by any application running on a Windows CE 5 device.

Haven't done this before so i'd be interested in knowing what techniques people would suggest to see if there is anything i've not considered.

All of the applications that need to receive this event are .NET Compact Framework based so "managed-only" solutions can be considered.

+1  A: 

Most of the solutions i've seen out there use a custom messaging protocol.

.Net Sockets have also been used.

I know the compact framework 3.5 has WCF in it but there are restrictions and there has been quite a bit of feedback saying it's not reliable.

The biggest issue with most of the mechanisms is serialization versioning.

See here for CF 3.5

Peter
+5  A: 

I swear I've answered this somewhere - here, newsgroups, blog, something - but I can't find it, so here it is again:

You really have 4 options for IPC under Windows CE. I'll focus on CF solutions here.

  1. Use a socket. This is a pain as the event source kind of needs to know about the sink's exxistence. It's certainly my least-favorite option, and I use it close to never.
  2. A named system event (a-la the CreateEvent API). This works for a simple boolean-type event like "this is on." CE is nice in that you can also associate a 32-bit value with the event (SetEventData). For a managed implementation, see this blog entry (the actual class is in the SDF).
  3. A Memory Mapped File. The SDF has an implementation that I've used in a couple customer projects, so it's pretty well tested. Someday I should do a blog post on how to use it, but you're smart and can likely figure it out from the docs.
  4. Point-to-point message queues. These are CE-specific, but way cool. The kernel uses them for a lot of system stuff. They are very fast and robust. Again, the SDF has an implementation. MSDN has an article on usage, but bear in mind the MSDN code has some bugs in it that the SDF has fixed.
ctacke
Hi, I want to confirm that SetEventData() is not available on Windows Mobile. Thank you.
afriza