1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

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 95bdd97768)
This commit is contained in:
Fabio Alessandrelli
2016-11-30 20:45:19 +01:00
parent c030e602e5
commit a46a643f90
18 changed files with 68 additions and 51 deletions

View File

@@ -38,14 +38,16 @@ class TCP_Server : public Reference {
OBJ_TYPE( TCP_Server, Reference );
protected:
IP_Address::AddrType ip_type;
static TCP_Server* (*_create)();
//bind helper
Error _listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY ,DVector<String> p_accepted_hosts=DVector<String>());
Error _listen(uint16_t p_port, DVector<String> p_accepted_hosts=DVector<String>());
static void _bind_methods();
public:
virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY, const List<String> *p_accepted_hosts=NULL)=0;
virtual Error listen(uint16_t p_port, const List<String> *p_accepted_hosts=NULL)=0;
virtual bool is_connection_available() const=0;
virtual Ref<StreamPeerTCP> take_connection()=0;