B
Brian Pugh
I am writing a 2 player network game for a class of mine and I have
the problem of when my app starts a new game, it creates a server (new
thread) then connects to that server through sockets (makes is simple
cause the other player uses the same connection code). My problem is
though that when my client trys to connect to the server, the server
is not guarantee to be waiting for connections then, leaving my client
to disconnect. I could just have the client loop a couple of times
until it gets a connection but I am wondering if there is a way to
delay the client thread for a bit (much like sleep(int) in C).
Brian Pugh
(e-mail address removed)
the problem of when my app starts a new game, it creates a server (new
thread) then connects to that server through sockets (makes is simple
cause the other player uses the same connection code). My problem is
though that when my client trys to connect to the server, the server
is not guarantee to be waiting for connections then, leaving my client
to disconnect. I could just have the client loop a couple of times
until it gets a connection but I am wondering if there is a way to
delay the client thread for a bit (much like sleep(int) in C).
Brian Pugh
(e-mail address removed)