| Vitali Gontsharuk 2006-05-15, 7:08 pm |
| Hi!
I have a problem programming a simple client-server game, which is
called pingpong ;-)
The final program will first be started as a server (nr. 2) and then as
a client. The client then sends the message "Ping" to the server, which
reads it and answers with a "Pong".
The game is really simple and the coding should be also very simple! But
for me it isn't.
By the way, the program uses datagram sockets (UDP). And, I'm using
Cygwin (don't think the problem occurs due to that).
What the program now does is, upon the client start, to send the "Ping"
message to the server, which in turn sends an answer to the client. The
"sendto" invoked in the start_server() function deliveres the length of
the used buffer "mesg" as a result - but the message can't be received
by the client, the execution blocks!
It must be an easy to solve problem, but I'm now at the end of my nerves
and can't see what the problem is.
If you could help me, I would really appreciate that!
Thanks in advance,
Vitali Gontsharuk
|