如何在运行任何服务/应用程序之前调用CreatePersistentUdpPortReservation? [英] How can I call CreatePersistentUdpPortReservation before any services/applications run?

查看:106
本文介绍了如何在运行任何服务/应用程序之前调用CreatePersistentUdpPortReservation?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows Server 2008 R2上运行了一项服务,需要从固定地址开始预留14,000个UDP端口。 CreatePersistentUdpPortReservation失败,因为该范围中的一个或多个端口已被其他服务打开,例如DFS。

I have a service running on Windows Server 2008 R2 which needs to reserve 14,000 UDP ports starting at a fixed address. CreatePersistentUdpPortReservation fails because one or more ports in the range have already been opened by other services e.g. DFS.

如何在其他服务等启动之前调用此方法。或者是否有注册表项可以设置为实现相同的目标。如果需要重新启动以进行预订,这不是问题。

How can I call this method before other services etc. start. Or are there registry keys which can be set to achieve the same goal. It is not a problem if a reboot is required to enact the reservation.

Alan

推荐答案

如果您保留其他服务希望使用的端口,那么这些服务可能会失败,因为它们使用众所周知的端口并期望它们可用。在保留时,您应该使用临时端口范围内的端口(49152-65535)。

If you reserve ports that other services wish to use, then those services will likely fail as they are using well-known ports and expect them to be available. When reserving, you should be using ports from the ephemeral port range (49152-65535).

理想情况下,您可以尽可能早地在引导过程中调用CreatePersistentUdpPortReservation(使服务引导加载)并且在TCPIP之后立即加载。)

Ideally you would call CreatePersistentUdpPortReservation as early in the boot process as you could (make your service boot load and have it load immediately after TCPIP).

不支持直接修改注册表来创建预订。

It is not supported to modify the registry directly to create the reservations.

希望这有帮助,


这篇关于如何在运行任何服务/应用程序之前调用CreatePersistentUdpPortReservation?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆