From 7eef15b73460062e4558857969919313e461f1e4 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sat, 29 Oct 2016 03:30:59 +0200 Subject: Set proper ip_type default for listen() and resolve_hostname() --- core/io/tcp_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/io/tcp_server.cpp') diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 53d6e900f3..894cccf691 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -58,7 +58,7 @@ Error TCP_Server::_listen(uint16_t p_port, IP_Address::AddrType p_type, DVector< void TCP_Server::_bind_methods() { - ObjectTypeDB::bind_method(_MD("listen","port","accepted_hosts"),&TCP_Server::_listen,DEFVAL(IP_Address::TYPE_IPV4), DEFVAL(DVector())); + ObjectTypeDB::bind_method(_MD("listen","port","ip_type", "accepted_hosts"),&TCP_Server::_listen,DEFVAL(IP_Address::TYPE_ANY),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); -- cgit v1.2.3 From 95bdd977686005d3d813eb09aca625384f1774c1 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. --- 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 894cccf691..29e8bd0c02 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 From c18c5013f837ea7d4de2f022d36f84e0abce6439 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 1 Dec 2016 06:34:05 +0100 Subject: Migrate int.IP_TYPE_ constants to IP.TYPE_ --- core/io/tcp_server.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'core/io/tcp_server.cpp') diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 29e8bd0c02..0dcec8001e 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -30,8 +30,6 @@ TCP_Server* (*TCP_Server::_create)()=NULL; -VARIANT_ENUM_CAST(IP_Address::AddrType); - Ref TCP_Server::create_ref() { if (!_create) @@ -68,5 +66,5 @@ void TCP_Server::_bind_methods() { TCP_Server::TCP_Server() { - ip_type = IP_Address::TYPE_ANY; + ip_type = IP::TYPE_ANY; } -- cgit v1.2.3 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 From c7bc44d5ad9aae4902280012f7654e2318cd910e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 1 Jan 2017 22:01:57 +0100 Subject: Welcome in 2017, dear changelog reader! That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games! --- core/io/tcp_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/io/tcp_server.cpp') diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 894cccf691..77a3d8331d 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3