mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-04-27 14:47:12 +02:00
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.
52 lines
939 B
C++
52 lines
939 B
C++
//
|
|
// EchoServer.h
|
|
//
|
|
// Definition of the EchoServer class.
|
|
//
|
|
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#ifndef EchoServer_INCLUDED
|
|
#define EchoServer_INCLUDED
|
|
|
|
|
|
#include "Poco/Net/Net.h"
|
|
#include "Poco/Net/ServerSocket.h"
|
|
#include "Poco/Thread.h"
|
|
#include "Poco/Event.h"
|
|
|
|
|
|
class EchoServer: public Poco::Runnable
|
|
/// A simple sequential echo server.
|
|
{
|
|
public:
|
|
EchoServer();
|
|
/// Creates the EchoServer.
|
|
|
|
EchoServer(const Poco::Net::SocketAddress& address);
|
|
/// Creates the EchoServer using the given address.
|
|
|
|
~EchoServer();
|
|
/// Destroys the EchoServer.
|
|
|
|
Poco::UInt16 port() const;
|
|
/// Returns the port the echo server is
|
|
/// listening on.
|
|
|
|
void run();
|
|
/// Does the work.
|
|
|
|
private:
|
|
Poco::Net::ServerSocket _socket;
|
|
Poco::Thread _thread;
|
|
Poco::Event _ready;
|
|
bool _stop;
|
|
};
|
|
|
|
|
|
#endif // EchoServer_INCLUDED
|