开发者

Communication between two programs on same computer – How?

I don’t know how to begin. After Googling, I’ve found this here:

//开发者_如何学GoThis is how you do it (kudos to sipwiz)
UdpClient udpServer = new UdpClient(localpt); 

//This is what the proprietary (see question) sender would do (nothing special) 
//!!! The following 3 lines is what the poster needs...
//(and the definition of localpt, of course)
UdpClient udpServer2 = new UdpClient();
udpServer2.Client.SetSocketOption(
    SocketOptionLevel.Socket,
    SocketOptionName.ReuseAddress, true);

udpServer2.Client.Bind(localpt);

But I don’t know what else I need. I tried an example from here, but got an error message: "An existing connection was forcibly closed by the remote host."

How do I proceed?


I'd suggest ditching UDP. Instead, use Named Pipes.

They are more reliable.


I think it's better to use WCF with Named Pipe binding


Named pipe is the best option on the same system. Due the fact that the performance is better then TCP cause the traffic is not using the network interfaces.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜