2

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

//This 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?

Community
  • 1
  • 1
ispiro
  • 26,556
  • 38
  • 136
  • 291

3 Answers3

5

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

They are more reliable.

Chris Laplante
  • 29,338
  • 17
  • 103
  • 134
2

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

meziantou
  • 20,589
  • 7
  • 64
  • 83
0

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.

Max
  • 1,068
  • 1
  • 10
  • 15