From a77a0118f6b0d0878a53e2c963d91763b311163d Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 1 Dec 2016 09:01:09 +0100 Subject: Allow setting ip_type for TCP/UDP and HTTP classes --- core/io/tcp_server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'core/io/tcp_server.cpp') diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 0dcec8001e..5f3f74131d 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -54,8 +54,14 @@ Error TCP_Server::_listen(uint16_t p_port, DVector p_accepted_hosts) { } +void TCP_Server::set_ip_type(IP::Type p_type) { + stop(); + ip_type = p_type; +} + void TCP_Server::_bind_methods() { + ObjectTypeDB::bind_method(_MD("set_ip_type","ip_type"),&TCP_Server::set_ip_type); ObjectTypeDB::bind_method(_MD("listen","port","accepted_hosts"),&TCP_Server::_listen,DEFVAL(DVector())); ObjectTypeDB::bind_method(_MD("is_connection_available"),&TCP_Server::is_connection_available); ObjectTypeDB::bind_method(_MD("take_connection"),&TCP_Server::take_connection); -- cgit v1.2.3