mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
25 lines
522 B
C++
25 lines
522 B
C++
#pragma once
|
|
|
|
#include "tcp_connection.h"
|
|
|
|
namespace EQ
|
|
{
|
|
namespace Net
|
|
{
|
|
class TCPServer
|
|
{
|
|
public:
|
|
TCPServer();
|
|
~TCPServer();
|
|
|
|
void Listen(int port, bool ipv6, std::function<void(std::shared_ptr<TCPConnection>)> cb);
|
|
void Listen(const std::string &addr, int port, bool ipv6, std::function<void(std::shared_ptr<TCPConnection>)> cb);
|
|
void Close();
|
|
void AddClient(uv_tcp_t *c);
|
|
|
|
private:
|
|
std::function<void(std::shared_ptr<TCPConnection>)> m_on_new_connection;
|
|
uv_tcp_t *m_socket;
|
|
};
|
|
}
|
|
} |