1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-04-23 20:57:12 +02:00
SqMod/vendor/POCO/Net/include/Poco/Net/UDPServerParams.h
Sandu Liviu Catalin 4a6bfc086c Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface.
Deprecated the external module API. It was creating more problems than solving.
Removed most built-in libraries in favor of system libraries for easier maintenance.
Cleaned and secured code with help from static analyzers.
2021-01-30 08:51:39 +02:00

123 lines
2.4 KiB
C++

//
// UDPServerParams.h
//
// Library: Net
// Package: UDP
// Module: UDPServerParams
//
// Definition of the UDPServerParams class.
//
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Net_UDPServerParams_INCLUDED
#define Net_UDPServerParams_INCLUDED
#include "Poco/Net/Net.h"
#include "Poco/Net/SocketAddress.h"
#include "Poco/Timespan.h"
namespace Poco {
namespace Net {
class Net_API UDPServerParams
/// A class encapsulating UDP server parameters.
{
public:
UDPServerParams(const Poco::Net::SocketAddress& sa,
int nSockets = 10,
Poco::Timespan timeout = 250000,
std::size_t handlerBufListSize = 1000,
bool notifySender = false,
int backlogThreshold = 10);
/// Creates UDPServerParams.
~UDPServerParams();
/// Destroys UDPServerParams.
const Poco::Net::SocketAddress& address() const;
/// Returns the server address.
Poco::Timespan timeout() const;
/// Returns polling timeout.
int numberOfSockets() const;
/// Returns nuber of sockets for the server.
std::size_t handlerBufListSize() const;
/// Returns the number of handler buffers allocated
/// before buffers start being reused.
bool notifySender() const;
/// Returns the flag inidcating whether server
/// should send notifications back to the client.
int backlogThreshold() const;
/// Size of mesage or error backlogs at which server
/// reports backlogs back to the client. Only meaningful
/// if notifySender() is true.
private:
UDPServerParams();
Poco::Net::SocketAddress _sa;
int _nSockets;
Poco::Timespan _timeout;
std::size_t _handlerBufListSize;
bool _notifySender;
int _backlogThreshold;
};
//
// inlines
//
inline const Poco::Net::SocketAddress& UDPServerParams::address() const
{
return _sa;
}
inline int UDPServerParams::numberOfSockets() const
{
return _nSockets;
}
inline Poco::Timespan UDPServerParams::timeout() const
{
return _timeout;
}
inline std::size_t UDPServerParams::handlerBufListSize() const
{
return _handlerBufListSize;
}
inline bool UDPServerParams::notifySender() const
{
return _notifySender;
}
inline int UDPServerParams::backlogThreshold() const
{
return _backlogThreshold;
}
} } // namespace Poco::Net
#endif // Net_UDPServerParams_INCLUDED