Network: First commit
Former-commit-id: ec8697acc51569f5043e4f70e4cf42f1c5dc487c
This commit is contained in:
43
include/Nazara/Network/TcpServer.hpp
Normal file
43
include/Nazara/Network/TcpServer.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Network module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_TCPSERVER_HPP
|
||||
#define NAZARA_TCPSERVER_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Network/TcpBase.hpp>
|
||||
#include <Nazara/Network/IpAddress.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class TcpClient;
|
||||
|
||||
class NAZARA_NETWORK_API TcpServer : public TcpBase
|
||||
{
|
||||
public:
|
||||
TcpServer() = default;
|
||||
inline TcpServer(TcpServer&& tcpServer);
|
||||
~TcpServer() = default;
|
||||
|
||||
bool AcceptClient(TcpClient* newClient);
|
||||
|
||||
inline IpAddress GetBoundAddress() const;
|
||||
inline UInt16 GetBoundPort() const;
|
||||
|
||||
inline SocketState Listen(NetProtocol protocol, UInt16 port, unsigned int queueSize = 10);
|
||||
SocketState Listen(const IpAddress& address, unsigned int queueSize = 10);
|
||||
|
||||
private:
|
||||
void OnClose() override;
|
||||
void OnOpened() override;
|
||||
|
||||
IpAddress m_boundAddress;
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Network/TcpServer.inl>
|
||||
|
||||
#endif // NAZARA_TCPSERVER_HPP
|
||||
Reference in New Issue
Block a user