12345678910111213141516171819202122 |
- #pragma once
- #define PORT_DOWN 49152
- #define PORT_UP 65535
-
-
- class CTool : public SSingleton<CTool>
- {
- public:
- CTool();
- ~CTool();
- uint16_t FindAvailableTcpPort(uint16_t begin = PORT_DOWN, uint16_t end = PORT_UP);
- uint16_t FindAvailableUdpPort(uint16_t begin = PORT_DOWN, uint16_t end = PORT_UP);
-
- private:
- std::vector<uint16_t> GetAllTcpConnectionsPort();
- std::vector<uint16_t> GetAllUdpConnectionsPort();
- };
|