简体   繁体   English

将大字节流缓冲区发送到另一个进程

[英]Sending large byte stream buffer to another process

What is the best way to send a byte stream from one Windows process to another assuming that both processes are running as a Windows service? 假设两个进程都作为Windows服务运行,那么从一个Windows进程向另一个进程发送字节流的最佳方法是什么? The data consists of an image buffer. 数据由图像缓冲区组成。 Each service is running on a separate server on the same subnet. 每个服务都在同一子网上的单独服务器上运行。

Should the second service that is receiving the buffer be a web service (as opposed to a Windows service), even though it will never be called on a website (just internally)? 即使永远不会在网站上(仅在内部)调用接收缓冲区的第二个服务,它是否应该是Web服务(而不是Windows服务)?

Is RPC the best method of communicating data between two windows services? RPC是在两个Windows服务之间通信数据的最佳方法吗? There will be a lot of data passed and performance is key. 将会传递大量数据,而性能是关键。

Development language is C# 4.0 开发语言是C#4.0

I would suggest using sockets. 我建议使用套接字。 RPCs have slight overhead over sockets and not worth the effort unless sending structured data. RPC在套接字上的开销很小,除非发送结构化数据,否则不值得付出努力。

If performance is key then use a shared memory segment. 如果性能是关键,则使用共享内存段。 Look up CreateFileMapping and MapViewOfFile on MSDN. 在MSDN上查找CreateFileMappingMapViewOfFile You can start from the aptly named "Creating Named Shared Memory" available at http://msdn.microsoft.com/en-us/library/windows/desktop/aa366551(v=vs.85).aspx 您可以从http://msdn.microsoft.com/zh-CN/library/windows/desktop/aa366551(v=vs.85).aspx上可用的恰当命名的“创建命名共享内存”开始

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM