Blame server.h

71057f
#ifndef SERVER_H
71057f
#define SERVER_H
71057f
71057f
71057f
#include "connection.h"
71057f
71057f
b42f0a
class Server: public Socket {
71057f
private:
71057f
	friend class Protocol;
b42f0a
	friend class Connection;
71057f
	
71057f
	Connection *connFirst, *connLast;
71057f
	
71057f
public:
71057f
	Server();
71057f
	~Server();
71057f
	
71057f
	bool open(Protocol &protocol, void *address, size_t addressSize);
b42f0a
	
b42f0a
private:
b42f0a
	void handleDisconnect(Connection &connection, bool error);
b42f0a
	
b42f0a
	void handleState() override;
b42f0a
	void handleEvents(unsigned int events) override;
71057f
	
71057f
protected:
51b3f0
	virtual Connection* onConnect(const void *address, size_t addressSize);
71057f
	virtual void onDisconnect(Connection *connection, bool error);
71057f
};
71057f
71057f
71057f
#endif
b42f0a