ok, im getting a strange error in my program.
like i said in an earlier post i have a client/server setup and im testing
over loop back.
the client is connecting to the server and communication is going both ways,
and then sometimes, all of a sudden, its like communication stops working.
I tried putting in printfs to see what the deal was but that makes it work
sometimes and other times it doesnt help so its really hard to get a grip on
whats going on, since an attempt at debugging alters the bug
server is checking for new connections every 1000 ms, and client/server are
checking for new data every 100ms using the difference between ticks to tell
if it should check again (ie…no sleep).
i found out a place where its failing by pure dumb luck w/ some printf
debugging. On the server, it fails at SDLNet_TCP_Recv with the error
"accept() failed".
I looked at the source for SDLNet_TCP_Recv and there are 2 places where it
can error, 1 sets an error message and the other does not. Since im getting
an “accept() failed” message (which comes from trying to accept from a
listening socket that has no connections waiting), im pretty sure its
failing in the second case which has a printf #ifdef’d out of the code that
says “Open Transport error: %d\n”. What is an open transport error and what
could cause it?
It would be nice if the code returned an error so i could know what was
going on better, but does anyone have idea idea what could be causing this
or what to do about it?
Thanks,
Atrix