Skip to content

Commit b8c635a

Browse files
Bugfix: need to use unsigned short to represent port range up to 65535
Signed short causes the number to become negative for specified initial port values > 32767, while range up to 65535 is allowed
1 parent 144ea6b commit b8c635a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Framework/Core/src/SimpleResourceManager.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ namespace framework
2121
/// This is a trivial implementation which can be used to do
2222
/// laptop deploys.
2323
class SimpleResourceManager : public ResourceManager {
24-
public:
24+
public:
2525
/// @a initialPort is the first port which can be used
2626
/// by this trivial resource manager.
2727
/// @a maxPorts is the maximum number of ports starting from
2828
/// initialPort that this resource manager can allocate.
29-
SimpleResourceManager(short initialPort, short maxPorts = 1000)
30-
: mInitialPort{initialPort},
31-
mMaxPorts{maxPorts}
29+
SimpleResourceManager(unsigned short initialPort, unsigned short maxPorts = 1000)
30+
: mInitialPort{ initialPort },
31+
mMaxPorts{ maxPorts }
3232
{}
3333
std::vector<ComputingResource> getAvailableResources() override;
34-
private:
34+
35+
private:
3536
int mInitialPort;
3637
int mMaxPorts;
3738
};

0 commit comments

Comments
 (0)