A study on IPC options on WinCE and Windows

來源:互聯網
上載者:User

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

 

Here is what I wanted to make:

 

§         A Server EXE which would have to run, both on a Win CE based device and on a Desktop machine.

§         A Client EXE which would 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 would 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 mechanism.

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 calls this 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 that Sockets would be the best way to go. Since I had so many 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 on even one 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 included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.