简体   繁体   English

如何在CE 6.0设备(作为服务器)和PC(作为客户端)之间进行通信

[英]How to communicate between CE 6.0 device (as server) and PC (as client)

We're in the process of developing a measurement device that will be running CE 6.0 with CF 3.5 on x86 embedded hardware, a PC is used to control the device and is connected with it using ethernet. 我们正在开发一种将在x86嵌入式硬件上运行带有CF 3.5的CE 6.0的测量设备的过程,一台PC用于控制该设备,并通过以太网与之连接。

We would like to communicate using interfaces (using DCOM (we know it is not supported by default on CE6), .NET Remoting or Web services) instead of using some sort of (custom) protocol. 我们希望使用接口(使用DCOM(我们知道CE6默认情况下不支持)、. NET Remoting或Web服务)进行通信,而不是使用某种(自定义)协议进行通信。 Calling methods defined in an interface is so much easier and elegant then parsing raw data. 与解析原始数据相比,在接口中定义的调用方法非常容易且优雅。

What would be the best solution in this case? 在这种情况下最好的解决方案是什么?

If you're using CE 6 and .NET Compact Framework 3.5, have you considered using the Windows Communication Foundation (WCF)? 如果您使用的是CE 6和.NET Compact Framework 3.5,是否考虑过使用Windows Communication Foundation(WCF)? You'd have to write your own transport, but when that is done, you will be able to consume your service interfaces with relative ease. 您必须编写自己的传输方式,但完成后,您将可以相对轻松地使用服务接口。

I've had some experience setting up comms between CE devices and a PC, and have used custom interfaces using winsock (thwacking some bytes back and forwards) and have tried SOAP. 我有一些在CE设备和PC之间建立通讯的经验,并且使用了使用winsock的自定义接口(来回转发一些字节),并尝试了SOAP。 In Windows CE 5.0, the Microsoft provided SOAP server took our device down somehow every couple of hours or so. 在Windows CE 5.0中,Microsoft提供的SOAP服务器每隔几个小时就会以某种方式关闭我们的设备。 I spent many weeks trying to work out what was wrong, thinking it was something I'd done wrong. 我花了数周的时间试图找出问题所在,并认为这是我做错了。 So, I prefer to stick to winsock now because at least I've got a chance of knowing what's going on and can fix it. 所以,我现在宁愿坚持Winsock,因为至少我有机会知道发生了什么并可以解决它。

Also, CE devices aren't always the quickest performers depending on what hardware you've got. 而且,取决于您所拥有的硬件,CE设备并非总是性能最快的设备。 Web-services take up some overhead and time converting data to XML, and this may be a performance hit you are or are not able to afford. Web服务占用一些开销和时间,将数据转换为XML,这可能会影响您承受或无法承受的性能。

As with Scott, we went down the road of using socket based communications, for performance and stability reasons. 与Scott一样,出于性能和稳定性的考虑,我们放弃了使用基于套接字的通信。 The code works well across all devices from Windows CE 2.1 up to mobile 6.0. 该代码在从Windows CE 2.1到移动6.0的所有设备上都能很好地工作。 I found the Windows CE developers handbook, ISBN 0-7821-2414-3, to be very useful in developing this functionality, albeit in C++ rather than C#. 我发现Windows CE开发人员手册ISBN 0-7821-2414-3对于开发此功能非常有用,尽管使用C ++而不是C#。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何与USB连接的Win CE设备进行通信 - How to communicate with Win CE device connected by usb 在服务器和客户端之间交流进度 - Communicate progress between server and client 如何使用 EMDK 2.6 关闭/重启移动设备 (Win CE 6.0)? - How to shutdown/reboot a mobile device (Win CE 6.0) with EMDK 2.6? PC和USB设备之间进行通讯的最佳方法是什么 - What is the best way to communicate between PC and USB device 如何使用C#从嵌入式系统(Windows CE 6.0)中的设备接收自定义消息? - How to receive custom message from a device in embedded system (Windows CE 6.0) using C#? Telnet服务器如何与客户端通信? - How does Telnet server communicate to the client? 如何在iis上的android客户端和c#服务器之间通信? - How can I communicate between android client and c# server on iis? 如何使用内存映射文件在同一台计算机上的服务器和客户端之间进行通信? - How do I communicate between a server and a client on the same computer using memory mapped files? 如何获取我的设备的IP和服务器IP(windows-CE) - how to get the IP of my device and the server IP (windows-CE) 使用 C# 在 Windows CE 6.0 中使用 USB HID 设备 - Consuming a USB HID device in Windows CE 6.0 using C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM