Page 1 of 1

Getting Networking to work

Posted: Mon Jun 24, 2013 4:45 am
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.

Re: Getting Networking to work

Posted: Mon Jun 24, 2013 4:53 am
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.)

Re: Getting Networking to work

Posted: Mon Jun 24, 2013 5:13 am
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.

Re: Getting Networking to work

Posted: Mon Jun 24, 2013 5:27 am
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.

Re: Getting Networking to work

Posted: Mon Jun 24, 2013 5:37 am
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.)

Re: Getting Networking to work

Posted: Mon Jun 24, 2013 6:08 am
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.

Re: Getting Networking to work

Posted: Tue Jun 25, 2013 3:43 am
by Wolfo
Bump - Nobody at all can help me with this? :(