简体   繁体   English

如果多个应用程序使用同一端口,端口8080上的自托管Web API是否会冲突? (WinRT的)

[英]Will a self hosted web api at port :8080 conflict if more than one app uses the same port? (Winrt)

I'm working on adding live tiles to my windows 8 app, and the best solution for me will be a web hosted api to send updates to the tiles. 我正在努力向Windows 8应用程序添加实时磁贴,而对我而言,最好的解决方案将是网络托管的api,用于向磁贴发送更新。

My concern is that I may end up using a port that's already in use by another app. 我担心的是,我最终可能会使用另一个应用程序已经在使用的端口。

So I'm wondering if it's even an issue. 所以我想知道这是否是一个问题。 Or if there is a way that I can check this before assigning the port. 或者,如果有一种方法可以在分配端口之前进行检查。

Thanks. 谢谢。

Only one application can bind to a port at a time. 一次只能将一个应用程序绑定到一个端口。 If something is already listening on port 8080 when your application tries to bind to it and listen your program will throw an exception. 如果在您的应用程序尝试绑定到端口8080并监听程序时已经在监听8080端口,则该程序将引发异常。

Yes, it is an issue. 是的,这是一个问题。 Two application cannot bind to the same port simultaneously. 两个应用程序不能同时绑定到同一端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM