123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #ifndef TCP_SERVER_H
- #define TCP_SERVER_H
- #include "core/io/ip.h"
- #include "core/io/net_socket.h"
- #include "core/io/stream_peer.h"
- #include "core/io/stream_peer_tcp.h"
- class TCP_Server : public Reference {
- GDCLASS(TCP_Server, Reference);
- protected:
- enum {
- MAX_PENDING_CONNECTIONS = 8
- };
- Ref<NetSocket> _sock;
- static void _bind_methods();
- public:
- Error listen(uint16_t p_port, const IP_Address &p_bind_address = IP_Address("*"));
- bool is_connection_available() const;
- Ref<StreamPeerTCP> take_connection();
- void stop();
- TCP_Server();
- ~TCP_Server();
- };
- #endif
|