Godot Version
v4.6.2.stable.official [71f334935]
Question
Hello!
I’m trying to make my little lan-only file transfer app in Godot,and I got an odd problem.Here’s the code first so i can explain properly.
func _try_sending(host_ip:String,host_port:int):
var err = client_component._request_connection(host_ip,host_port)#just connects to the host
if err == OK:
stats.text = "Connecting..."
await get_tree().create_timer(1).timeout
stats.text = "Connected!"
client_component._send_file("res://Test/test_files/large_sample.zip")
else:
stats.text = "Failed to connect!"
When the stats shows that it’s connecting, the game just crashes Godot! but it only happens when I send a file bigger then 1 MB.
Here’s the send file:
###=====================SEND===================###
func _send_file(path:String):
var file_ = FileAccess.open(path,FileAccess.READ)
var file_length : int = file_.get_length()
I have tried to open the file in a new project and it works as expected.
It just works smoothly with 500KB-ish files.
I’m using TCPStream to send the data, if it helps.
Little screenshot:
Normaly,after clicking send it almost immediately shows connected.
Thanks : )
