put_var adding extra data over pipe

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By wombatTurkey
:warning: Old Version Published before Godot 3 was released.

Hey all!

So, I am using put_var to connect to my tcp server via thePacketPeer class, but for some odd reason it is sending extra data over the pipe.

For example:

func send(data):
	if client.is_connected():
		print("Sending: "+str(data))
		# Send data
		wrapped_client.put_var(str(data))

Will show:
enter image description here

MY TCP server is in nodejs, but, this isn’t a node problem because when I send data from telnet or another tcp application, the extra data isn’t there. It’s coming from godot. Any way around this? Thanks =]

It’s funny/weird because Godot will print this:

enter image description here

Which doesn’t have the extra data… Hmmm

I found the solution:

I was using PacketPeerStream’s put_var instead of StreamPeerTCP’s put_utf8_string.

Works now :smiley:

wombatTurkey | 2016-05-28 22:52