for(z=0;z<255;z++){
if(cn[z].used){
bre=cn[z].client.recv(f,SBSIZE,0);
if(bre>0) handleinput(f, bre, z);
if(bre==-1) err=errno;
if (err!=EWOULDBLOCK) HandleClientSocketError(z,err);
}
}
It dies when a client is connected. I know it dies within this loop due to recent debugging. If no data comes in from recv, handleinput is not called, and when it terminates, no socket errors are reported.
Any suggestions?
Simple program..."Terminated"..."Killed"
I have a simple lobby server program. It never had any problems on Windows, but when on Linux or FreeBSD, the program kills itself for no reason in a loop that looks like this:
looks good to me, i guess your error is somewhere else. maybe a memory violation. there's a cool program to spot them - valgrind (developer.kde.org/~sewardj). it finds EVERYTHING! run your program with
valgrind --tool=addrcheck ./my-program my-parameters
and have a look at the output. most likely it will find the problem.
valgrind --tool=addrcheck ./my-program my-parameters
and have a look at the output. most likely it will find the problem.
gdb your_program
run it, crash it, type "bt" and give us the backtrace. let's see what it looks like. maybe also tell us what line exactly causes the crash.
run it, crash it, type "bt" and give us the backtrace. let's see what it looks like. maybe also tell us what line exactly causes the crash.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement