WCF 和 REST 应用程序在同一端口上使用不同的端点,这样可以吗?

WCF and REST app using different endpoints on the same port, is this ok?

我有一个 WCF 应用程序(应用程序 A)已在端口 XXX3 上运行 运行 多年,现在我已经创建了同一应用程序(应用程序 B)的 RESTful 版本。我最初想在端口 XXX4 上设置应用程序 B,但我必须处理阻止端口的公司安全策略。

如果我 运行 端口 XXX3 上的应用程序 B,它似乎 运行 正常,应用程序 A 似乎也没有任何问题。

我一直认为给定的应用程序应该使用自己的端口...所以我担心如果在同一端口上,应用程序 A 和 B 之间会发生冲突。我应该担心冲突还是这不是问题?我读到的所有内容似乎也表明它们应该在不同的端口上。

最后一条信息...由于应用程序 A 是 WCF 而应用程序 B 是 .NET Core web api 应用程序,它们都使用不同的端点,所以我怀疑这就是为什么没有似乎没有任何冲突。端点本身决定端口数据的路由位置吗?任何人都可以给出一个简单的网络解释,说明为什么这似乎在同一个端口上与他们一起工作,以及是否可以以这种方式离开它 运行ning?

WCF and REST app using different endpoints on the same port, is this ok?

TL;DR: 是的。

I have always been under the impression that a given app should use its own port

一般是。

Should I be concerned about conflicts or is this a non-issue? No. WCF apps hosted in IIS have had the ability to share ports for sometime now. (below)

当托管在 IIS 上时,WCF 应用现在能够共享 sometime 的端口。

这是MSDN has to say(我强调的):

The ability to share ports across multiple HTTP applications has long been a feature of Internet Information Services (IIS). However, it was only with the introduction of HTTP.SYS (the kernel-mode HTTP protocol listener) with IIS 6.0 that this infrastructure was fully generalized. In effect, HTTP.SYS allows arbitrary user processes to share the TCP ports dedicated to HTTP traffic. This capability allows many HTTP applications to coexist on the same physical machine in separate, isolated processes while sharing the network infrastructure required to send and receive traffic over TCP port 80. The Net.TCP Port Sharing Service enables the same type of port sharing for net.tcp applications.

同时,.NET Core 应用程序也可以通过 HTTP.sys 中的 TCP 端口共享受益,ASP.NET Core 中的 Web 服务器实现。

MSDN:

HTTP.sys is a web server for ASP.NET Core that only runs on Windows.

HTTP.sys supports the following features:

  • Windows Authentication
  • Port sharing ...

OP

One final piece of info... due to app A being WCF and app B being a .NET Core web api app, they both use different endpoints, so I suspect that is why there don't appear to be any conflicts

它们可能有两个不同的逻辑端点,但两者都可以通过公共 HTTP.SYS 共享 TCP 80。这与托管在 IIS 中的多个 WCF 应用程序共享 http://xxx:80/<service-suffix>.

没有什么不同