WCF: Net.TCP multiple bindings, same port, different IP Addresses

后端 未结 3 415
暖寄归人
暖寄归人 2020-12-29 12:40

I\'ve run into a problem. I\'m a little new at WCF so any help would be greatly appreaciated.

Here\'s my code:

public static void StartHosts()
    {
         


        
3条回答
  •  感动是毒
    2020-12-29 13:20

    Mel,

    While I've never tried this before myself, here's some samples to look at that I've heard before. You may want to create your binding object first and then add the same instance to the AddServiceEndpoint method, just a thought so you're not creating new bindings every time as I remember reading somewhere that netTCPBindings should be a 1:1 relationship with the address (even though you're using different addresses).

    I don't think you have to worry about port sharing as your opening up multiple ports.

    Here's a sample of what you may want to accomplish with multiple ports.

    http://www.aspfree.com/c/a/Windows-Scripting/WCF-and-Bindings/2/

    Here's a good sample for using portsharing on the NetTcpBinding.

    http://blogs.msdn.com/drnick/archive/2006/08/08/690333.aspx

    -Bryan

提交回复
热议问题