0 votes

I am attempting to write a simple interface to a server I wrote that uses UDP style sockets. I just need to be able to send and receive a bit of text from a given IP and port number, and display the input text in a formatted way. As of right now, I am having troubles with getting the PacketPeerUDP object to work how I want it to, and am not sure if it is the correct way to go about it.
The code:

var IP_SERVER = ""
var PORT_SERVER = 70
var PORT_CLIENT = 70
var socketUDP = PacketPeerUDP.new()

func _ready():
    var socket = PacketPeerUDP.new()
    socket.set_dest_address(IP_SERVER, PORT_SERVER)
    print("Sent package.")

As of right now, whenever I run it, it does get to the point that it prints out the "Sent package" message, but on the server I am running, it does not get any input. One thing that I have tried is closing the socket after sending the packet, but that does not fix the issue.

Godot version v3.5.stable.arch_linux
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.