diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-10-26 14:32:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-26 14:32:51 +0200 |
commit | c67e3a485dedae96b82c3356d5f45ab0509d7759 (patch) | |
tree | 748ab44c8ec645a8eee950991210bf6c620651d1 /core/io/tcp_server.cpp | |
parent | c7f9d853e206c15981330af46cfd0a0fc43fc5ef (diff) | |
parent | 80e911647c5df21c5b6a06876f1d48e21cd1f5fc (diff) | |
download | redot-engine-c67e3a485dedae96b82c3356d5f45ab0509d7759.tar.gz |
Merge pull request #6925 from godotengine/ipv6
Adding IPv6 support
Diffstat (limited to 'core/io/tcp_server.cpp')
-rw-r--r-- | core/io/tcp_server.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 274d20a48a..53d6e900f3 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -30,6 +30,8 @@ TCP_Server* (*TCP_Server::_create)()=NULL; +VARIANT_ENUM_CAST(IP_Address::AddrType); + Ref<TCP_Server> TCP_Server::create_ref() { if (!_create) @@ -44,19 +46,19 @@ TCP_Server* TCP_Server::create() { return _create(); } -Error TCP_Server::_listen(uint16_t p_port,DVector<String> p_accepted_hosts) { +Error TCP_Server::_listen(uint16_t p_port, IP_Address::AddrType p_type, DVector<String> p_accepted_hosts) { List<String> hosts; for(int i=0;i<p_accepted_hosts.size();i++) hosts.push_back(p_accepted_hosts.get(i)); - return listen(p_port,hosts.size()?&hosts:NULL); + return listen(p_port,p_type, hosts.size()?&hosts:NULL); } void TCP_Server::_bind_methods() { - ObjectTypeDB::bind_method(_MD("listen","port","accepted_hosts"),&TCP_Server::_listen,DEFVAL(DVector<String>())); + ObjectTypeDB::bind_method(_MD("listen","port","accepted_hosts"),&TCP_Server::_listen,DEFVAL(IP_Address::TYPE_IPV4), 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); ObjectTypeDB::bind_method(_MD("stop"),&TCP_Server::stop); |