diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-02-12 23:31:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-12 23:31:40 +0100 |
commit | 70b9aa379d99c78f6db87344e3002808dac70bfa (patch) | |
tree | 4f83bb38a0fe8b636640cb9b4eb0cd0b82a0b9c6 /core/io/tcp_server.cpp | |
parent | 117a83fcb916cb02777dea73fb642216fd2e1d79 (diff) | |
parent | 5dc7c920bf1c4bb160d39e13ad6136d80badd7ae (diff) |
Merge pull request #7581 from Faless/v6_wild_bind
TCP/UDP listen bind to address and bugfixes
Diffstat (limited to 'core/io/tcp_server.cpp')
-rw-r--r-- | core/io/tcp_server.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index bfa5dce58f..cb82b3fc55 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -44,25 +44,9 @@ TCP_Server* TCP_Server::create() { return _create(); } -Error TCP_Server::_listen(uint16_t p_port, PoolVector<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); - -} - -void TCP_Server::set_ip_type(IP::Type p_type) { - stop(); - ip_type = p_type; -} - void TCP_Server::_bind_methods() { - ClassDB::bind_method(_MD("set_ip_type","ip_type"),&TCP_Server::set_ip_type); - ClassDB::bind_method(_MD("listen","port","accepted_hosts"),&TCP_Server::_listen,DEFVAL(PoolVector<String>())); + ClassDB::bind_method(_MD("listen","port","bind_address"),&TCP_Server::listen,DEFVAL("*")); ClassDB::bind_method(_MD("is_connection_available"),&TCP_Server::is_connection_available); ClassDB::bind_method(_MD("take_connection"),&TCP_Server::take_connection); ClassDB::bind_method(_MD("stop"),&TCP_Server::stop); @@ -72,5 +56,5 @@ void TCP_Server::_bind_methods() { TCP_Server::TCP_Server() { - ip_type = IP::TYPE_ANY; + } |