A Study on IPC options on WinCE and windows

Source: Internet
Author: User
Tags readfile

I wanted to make a client-server application that wocould run both on WinCE/Windows Mobile 5.0 PPC/SP and windows.

 

Here is what I wanted to make:

 

§ServerEXE which wowould have to run, both on a Win CE based device and on a desktop machine.

§ClientEXE which wocould talk to the server. The scenario involved running several instances of client EXE running both on desktop and device.

 

The obvious choice was to write a common server/client code which wocould run both on device and for desktop.

 

So I started looking at the various IPC options that both wince and windows provide to come with an intersection set and then finally choose one of the options from the set.

 

Surprisingly the Intersection Set was really small. L

 

Here is the result of my study.

 

 

IPC Mechanisms

Windows

Win CE

References

DCOM

Supported.

 

Provides an option to run the server as a out proc COM Component

Not supported.

 

DCOM is an optional component. So you might run into the risk of not able to run your server EXE on the device.

Wince: http://blogs.msdn.com/cenet/archive/2005/07/13/438424.aspx

File mapping/Shared Memory

Supported.

 

File mapping is supported on Windows platform and you can use this via createfilemapping, mapviewoffile, readfile, writefile APIs.

Partially supported.

 

File mapping is also supported by Win CE, but there is a caveat to it. Here is what msdn has to say:

 

"This function will not work on a Windows CE-based platform that does not support page-in."

Wince: http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/wcesdkr/html/_ wcesdk_win32_createfilemapping.asp (read the remarks Section)

Message Queues

Not supported.

 

Windows does not seem to be supporting this. At least the msdn documentation does not list this as a possible IPC mechanic.

Supported.

 

Wince supports message queues.

 

You can use the createmsgqueue, writemsgqueue etc APIs to achieve it.

Windows: http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/IPC/base/interprocess_communications.asp

Pipes

Supported.

 

Windows supports it via createnamedpipe, writefile, readfile etc APIs.

Not supported.

 

There is no support for pipes specifically on wince.

 

But they claim that a point-to-point Message Queue can be regarded as some sort of pipe.

Wince: http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/dncenet/html/intercommwindowscenetinterprocesscommunication. asp (read the abstract Section)

Mailslots/mailbox

Supported.

 

Desktop callthis mail slots. Take a look at: createmailslot, writefile, readfile etc APIs.

Not supported.

 

The mail slot APIs are not supported on wince.

 

But there is an implementation of one-way "Mailbox" concept described in msdn.

Win CE: http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/dncenet/html/intercommwindowscenetinterprocesscommunication. asp

Sockets

Supported

Supported

 

 

 

Looking at all the possible options, I finally felt thatSocketsWocould be the best way to go. Since I had so far device platforms to support, I did not wanted to take the risk of choosing something that works on desktop and the same thing not working onEvenOne of the device platforms.

 

This is just my observation. Please let me know if there is any other option that I have missed out. Hope this helps.

 

(This posting is provided "as is" with no warranties, and confers no rights. Use of specified ded script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.