#pragma once

#include <string>
#include <functional>

class Socket;

class PlatformSocketServer
{
public:
	struct Address
	{
		std::string mPrefix;
		std::string mHost;
		unsigned int mPort{8000};
	};

	struct Result
	{
		enum class Status
		{
			OK,
			FAILED
		};

		Status mStatus{ Status::FAILED };
		std::string mErrorMessage;
		int mErrorCode{ -1 };
		std::string mBody;
	};

	using onConnectionSuccessFunc = std::function<void(Socket*)>;
	using onConnectionFailedFunc = std::function<void(const Result&)>;
	virtual void listen(const Address& address, onConnectionSuccessFunc connectionSuccessFunc, onConnectionFailedFunc connectionFailedFunc) = 0;

	virtual void shutDown() {};
};