Follow

Why does accept() wreck my debugger? :blobpanic:

· · Web · 2 · 0 · 1

struct sockaddr_in clientaddr;
socklen_t addrlen;

addrlen = sizeof(clientaddr);
clients[slot] = accept (listenfd, (struct sockaddr *) &clientaddr, &addrlen);

@matrix If it's weird UD, did you remember to memset clear the struct?

@matrix I don't know what else to suggest without seeing more of it, sorry

@applejack I'm basing it off this blog blog.abhijeetr.com/2010/04/ver and looks like the same exact thing happens with the code from the blog.

@matrix maybe the debugger isn't that happy about type conversion inside the call. It is fine, they are addresses anyway, but you know, debuggers are strange beasts. Good luck!

@dancer_xiv
Thanks. The code works and it's just school homework anyway.

Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.