Getting Networking to work

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
Wolfo
Prole
Posts: 4
Joined: Mon Jun 24, 2013 4:13 am

Getting Networking to work

Post by Wolfo »

All I did so far is taking client and server files from this network tutorial and include them.
It seems to work and the client seems to connect to server although something looks like not working well.
I have no idea what I am doing wrong, so here is the code. I hate to be this newbie but- what am I doing wrong? :cry:

It doesn't seem to send nor receive any data. It should print players connected and the total amount for server and client (#world) but it stays zero no matter how many connect.
Attachments
proj.love
(7.57 KiB) Downloaded 105 times
Last edited by Wolfo on Mon Jun 24, 2013 5:13 am, edited 1 time in total.
User avatar
NightKawata
Party member
Posts: 294
Joined: Tue Jan 01, 2013 9:18 pm
Location: Cyberspace, Room 6502
Contact:

Re: Getting Networking to work

Post by NightKawata »

Something looks like not working well?
I can't understand the problem. I'm sure if you describe your situation in further detail, the members of this forum can help you out, though.

(Off topic: Oh god. 69th post.)
"I view Python for game usage about the same as going fishing with a stick of dynamite. It will do the job but it's big, noisy, you'll probably get soaking wet and you've still got to get the damn fish out of the water." -taylor
Wolfo
Prole
Posts: 4
Joined: Mon Jun 24, 2013 4:13 am

Re: Getting Networking to work

Post by Wolfo »

NightKawata wrote:Something looks like not working well?
I can't understand the problem. I'm sure if you describe your situation in further detail, the members of this forum can help you out, though.
Sorry, added more info.
batatinha
Prole
Posts: 22
Joined: Mon Jun 24, 2013 3:49 am

Re: Getting Networking to work

Post by batatinha »

I'm not familiar with UDP, but as much as i know, it's not very good to games because there is the risk of data loss, i think you should use TCP instead...

But out of this discussion of tcp vs udp, you only do settimeout(0) after the connection, otherwise it will not connect.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Getting Networking to work

Post by slime »

batatinha wrote:I'm not familiar with UDP, but as much as i know, it's not very good to games because there is the risk of data loss, i think you should use TCP instead...

But out of this discussion of tcp vs udp, you only do settimeout(0) after the connection, otherwise it will not connect.
http://www.gafferongames.com/networking ... udp-vs-tcp

tl;dr: TCP has huge disadvantages for realtime game networking. You'll typically want UDP with a layer on top so you can optionally send reliable/ordered packets when needed (which may be less often than you think.)
Wolfo
Prole
Posts: 4
Joined: Mon Jun 24, 2013 4:13 am

Re: Getting Networking to work

Post by Wolfo »

batatinha wrote:I'm not familiar with UDP, but as much as i know, it's not very good to games because there is the risk of data loss, i think you should use TCP instead...

But out of this discussion of tcp vs udp, you only do settimeout(0) after the connection, otherwise it will not connect.
But it does connectithink cause if I connect and close the server it gives a connection lost error.
Wolfo
Prole
Posts: 4
Joined: Mon Jun 24, 2013 4:13 am

Re: Getting Networking to work

Post by Wolfo »

Bump - Nobody at all can help me with this? :(
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 89 guests