• entries
271
969
• views
189856

# Ughhh....

81 views

Hey everybody!

I'm just about to shoot myself for not seeing this error earlier, I couldn't understand why the server crashed, even when no client was connected to it, so I spent a couple hours today reading the raknet docs and trying to find my error, when in reality, it was a simple typo that fit in so well with all the other code that I didn't even notice it.

Who can spot the bug that crashes the server everytime this function is called?
void DENet::DoServerStuff(){Packet * p = server->Receive();                if(p != NULL) {            HandleServerPacket(p);                        client->DeallocatePacket(p);        }}

Answer: See the whole "client->DeallocatePacket(p);"? Turns out, it doesn't exist on the server because there's no needs for a client interface on the server, but I accidently wrote it in there, and it wasn't giving me any compile errors because it's there, it just isn't initailized.... Damn, I want my 3 hours back......

## 1 Comment

Hehe, oh how I love those trivial bugs that waste hours of our precious lifetimes as coders. [grin]

If it makes you feel any better, I had one just like this that wasted a good few hours of my day as well. [sad]

## Create an account

Register a new account