Continued ripping up the source.
[aesalon.git] / monitor / src / TCPServerSocket.h
blobe937c74458e1a57f95ecaf0fc3bd2f9ce0cc00d9
1 #ifndef AESALON_MONITOR_TCPSERVER_SOCKET_H
2 #define AESALON_MONITOR_TCPSERVER_SOCKET_H
4 #include <vector>
6 #include "TCPSocket.h"
7 #include "misc/EventQueue.h"
8 #include "misc/SmartPointer.h"
10 namespace Aesalon {
11 namespace Monitor {
13 class TCPServerSocket {
14 public:
15 typedef std::vector<Misc::SmartPointer<TCPSocket> > socket_list_t;
16 private:
17 int socket_fd;
18 int port;
19 socket_list_t socket_list;
20 public:
21 TCPServerSocket(int port);
22 virtual ~TCPServerSocket();
24 void accept_connections();
25 void wait_for_connection();
26 void remove_invalid_sockets();
27 void disconnect_all();
29 void send_data(std::string data);
30 void send_data(Misc::SmartPointer<Misc::EventQueue> data);
32 int get_port() const;
35 } // namespace Monitor
36 } // namespace Aesalon
38 #endif