@Port()
New in 2.0Generate random server ports
Network InformationSince 2.0.0
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| min | Integer | — | 1024 | Minimum port, default 1024 (min 0) |
| max | Integer | — | 65535 | Maximum port, default 65535 (max 65535) |
Usage
@Port()Generate random server port
Example:
@Port()
Output:
1025@Port(min,max)Generate server port within specified min~max range
Example:
@Port(5000,10000)
Output:
6000