summaryrefslogtreecommitdiff
path: root/core/io/tcp_server.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2016-12-01 09:01:09 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2016-12-09 18:24:59 +0100
commita77a0118f6b0d0878a53e2c963d91763b311163d (patch)
tree159cbc303043c429cfdbe6f9cd4498bbde15ec46 /core/io/tcp_server.cpp
parentc18c5013f837ea7d4de2f022d36f84e0abce6439 (diff)
Allow setting ip_type for TCP/UDP and HTTP classes
Diffstat (limited to 'core/io/tcp_server.cpp')
-rw-r--r--core/io/tcp_server.cpp6
1 files changed, 6 insertions, 0 deletions
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<String> 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<String>()));
ObjectTypeDB::bind_method(_MD("is_connection_available"),&TCP_Server::is_connection_available);
ObjectTypeDB::bind_method(_MD("take_connection"),&TCP_Server::take_connection);