You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Remove set_ip_type from network classes (no longer needed)
- TCP:
- `listen` bind to wildcard "*" -> dual stack socket
- `listen` bind to address -> socket from address type
- `connect` -> resolve using best protocol (UNSPEC), socket from address type
- UDP:
- `listen` bind to wildcard "*" -> dual stack socket
- `listen` bind to address -> socket from address type
- `put_packet`/`put_var` -> resolve using TYPE_ANY (UNSPEC), socket from address type
(to change socket type you must first call `close` it)
(cherry picked from commit 88a56ba783)
This commit is contained in:
@@ -36,7 +36,7 @@ Error StreamPeerTCP::_connect(const String &p_address, int p_port) {
|
||||
if (p_address.is_valid_ip_address()) {
|
||||
ip = p_address;
|
||||
} else {
|
||||
ip = IP::get_singleton()->resolve_hostname(p_address, ip_type);
|
||||
ip = IP::get_singleton()->resolve_hostname(p_address);
|
||||
if (!ip.is_valid())
|
||||
return ERR_CANT_RESOLVE;
|
||||
}
|
||||
@@ -45,14 +45,8 @@ Error StreamPeerTCP::_connect(const String &p_address, int p_port) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
void StreamPeerTCP::set_ip_type(IP::Type p_type) {
|
||||
disconnect();
|
||||
ip_type = p_type;
|
||||
}
|
||||
|
||||
void StreamPeerTCP::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("set_ip_type", "ip_type"), &StreamPeerTCP::set_ip_type);
|
||||
ObjectTypeDB::bind_method(_MD("connect", "host", "port"), &StreamPeerTCP::_connect);
|
||||
ObjectTypeDB::bind_method(_MD("is_connected"), &StreamPeerTCP::is_connected);
|
||||
ObjectTypeDB::bind_method(_MD("get_status"), &StreamPeerTCP::get_status);
|
||||
@@ -81,8 +75,6 @@ StreamPeerTCP *StreamPeerTCP::create() {
|
||||
}
|
||||
|
||||
StreamPeerTCP::StreamPeerTCP() {
|
||||
|
||||
ip_type = IP::TYPE_ANY;
|
||||
}
|
||||
|
||||
StreamPeerTCP::~StreamPeerTCP(){
|
||||
|
||||
Reference in New Issue
Block a user