TCPServerParams.cpp 948 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // TCPServerParams.cpp
  3. //
  4. // Library: Net
  5. // Package: TCPServer
  6. // Module: TCPServerParams
  7. //
  8. // Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH.
  9. // and Contributors.
  10. //
  11. // SPDX-License-Identifier: BSL-1.0
  12. //
  13. #include "Poco/Net/TCPServerParams.h"
  14. namespace Poco {
  15. namespace Net {
  16. TCPServerParams::TCPServerParams():
  17. _threadIdleTime(10000000),
  18. _maxThreads(0),
  19. _maxQueued(64),
  20. _threadPriority(Poco::Thread::PRIO_NORMAL)
  21. {
  22. }
  23. TCPServerParams::~TCPServerParams()
  24. {
  25. }
  26. void TCPServerParams::setThreadIdleTime(const Poco::Timespan& milliseconds)
  27. {
  28. _threadIdleTime = milliseconds;
  29. }
  30. void TCPServerParams::setMaxThreads(int count)
  31. {
  32. poco_assert (count > 0);
  33. _maxThreads = count;
  34. }
  35. void TCPServerParams::setMaxQueued(int count)
  36. {
  37. poco_assert (count >= 0);
  38. _maxQueued = count;
  39. }
  40. void TCPServerParams::setThreadPriority(Poco::Thread::Priority prio)
  41. {
  42. _threadPriority = prio;
  43. }
  44. } } // namespace Poco::Net