Why does accept() wreck my debugger? ![]()
@matrix If it's weird UD, did you remember to memset clear the struct?
@applejack I didn't do that. That could be a issue.
@applejack Nope, that's not it
@matrix I don't know what else to suggest without seeing more of it, sorry
@applejack I'm basing it off this blog https://blog.abhijeetr.com/2010/04/very-simple-http-server-writen-in-c.html 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.
struct sockaddr_in clientaddr;
socklen_t addrlen;
addrlen = sizeof(clientaddr);
clients[slot] = accept (listenfd, (struct sockaddr *) &clientaddr, &addrlen);