[Solved] Moving Files From compter to computer using UDP?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

[Solved] Moving Files From compter to computer using UDP?

Post by I~=Spam »

Hello all! (this is my first time posting here in the forums) :awesome:

I'm not sure how to use LuaSocket to transfer files from one PC to another. I have read and and do understand this tutorial on UDP:
But it only supports the passing of strings. :o

Any help or advice is much appreciated.

EDIT: I found the answer... I can convert all of the files to strings using love.filesystem.read and send that using LuaSocket's UDP and then on the other computer convert that back to a file and save it using love.filesystem.write. :ultraglee:
Last edited by I~=Spam on Sun Dec 23, 2012 5:50 pm, edited 1 time in total.
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Moving Files From compter to computer using LuaSocket?

Post by Robin »

You might want to use TCP rather than UDP, because it is reliable. You probably don't want your files to be missing pieces or otherwise be messed up. UDP is for situations where old information = bad information, like in multiplayer FPSes.
Help us help you: attach a .love.
User avatar
Przemator
Party member
Posts: 107
Joined: Fri Sep 28, 2012 6:59 pm

Re: Moving Files From compter to computer using LuaSocket?

Post by Przemator »

TCP is one thing, the other this is that default chunk/packet size is 8 KB, so you have to split your string into pieces, send each piece and then put them back together. not so simple...
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: Moving Files From compter to computer using LuaSocket?

Post by I~=Spam »

Hmmmm... Do you know a good tutorial on using TCP?
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Post Reply

Who is online

Users browsing this forum: pgimeno and 3 guests