문제

I have a message object serialized as binary data stream (it can be any std::streambuf), and i want to transfer it to another process. The key is, server application must handle many clients, connection have to be asynchronous (because of multiple clients), and bidirectional (under the hood it may be implemented by two separated connections). Messages have variable length and should be queued. What method of IPC should i pick for this? Is there any simple way to transfer stream buffer through applications? Speed is not critical, but it will be good not to block application for too much time. Anything will be done locally under Windows (i aim to XP and newer), no network support required.

I also need a possibility of listening to incoming connections. Server should automatically detect new connections, do some handshake and accept, if it is compatible. I am aware of that i need to write many of things i mentioned on my own. Anyway, it must be possible to achieve but of course simpler is better.

도움이 되었습니까?

해결책

You can use named pipes in windows. See MSDN ref: http://msdn.microsoft.com/en-us/library/aa365150%28v=vs.85%29.aspx

You can also set it to be full duplex (bi-directional) and asynchronous. If you are familiar with File I/O APIs on windows then it should be straightforward to use.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top