문제

I'm building a WCF P2P service using the PNRP functionality.

I see that I can assign a port to the Bindings... but most of the examples do not. Is there a reason I should or shouldn't give it a port?

도움이 되었습니까?

해결책

If you don't assign a port, WCF will choose a random available port automatically. The local port information is broadcast to peers as part of the PNRP process, so setting a local port explicitly is more to make your application predictable than anything else.

I usually set my ports explicitly so that I can document them to my customers. This is especially important when a customer uses a 3rd party firewall that I can't easily configure in code. If your app assigns a random port, they won't know what port to unblock in their firewall software.

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