From a46a643f90b4a5e93f94e9223e58a7bf83dc4e2a Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Wed, 30 Nov 2016 20:45:19 +0100 Subject: Use an instance variable for ip_type in raw sockets PacketPeerUDP/StreamPeerTCP/TCP_Server now uses an instance variable to store the selected ip_type (IPv4/IPv6/ANY, where ANY = dual stack). All calls to resolve addresses, sending/receving data, connecting/listening will use that socket type. (cherry picked from commit 95bdd977686005d3d813eb09aca625384f1774c1) --- core/io/tcp_server.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/io/tcp_server.cpp') diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 894cccf69..29e8bd0c0 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -46,19 +46,19 @@ TCP_Server* TCP_Server::create() { return _create(); } -Error TCP_Server::_listen(uint16_t p_port, IP_Address::AddrType p_type, DVector p_accepted_hosts) { +Error TCP_Server::_listen(uint16_t p_port, DVector p_accepted_hosts) { List hosts; for(int i=0;i())); + 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); ObjectTypeDB::bind_method(_MD("stop"),&TCP_Server::stop); @@ -68,4 +68,5 @@ void TCP_Server::_bind_methods() { TCP_Server::TCP_Server() { + ip_type = IP_Address::TYPE_ANY; } -- cgit v1.2.3-70-g09d2