Yikes! I posted this just a few minutes ago. The code fails on 6.3.2. But after correcting a few compiler isms, it works correctly under 6.4. As it turns out the target for this code is 6.5 so I’m ok, but does anyone have any idea what is going wrong on 6.3.2?
Maybe someone can look over my shoulder with this basic TCP/IP problem I’m having.
The code attached should make TCPdaytime without any errors. The code is copied almost exactly from Comer and Steven’s classic “Internetworking with TCP/IP VOlume III/BSD Socket Version”.
Basically the code sets up a socket, listens, and then runs accept. Accept fails every time with a bad-file errno. If you put in a sleep before the accept, and you run “netstat -a” you can see a perfectly good socket listening on the port.
I’m almost 100% sure that I entered this code and had it working a year ago, so I’m baffled. I’ve run it on two different machines so it probably isn’t some local config thing either.
Thanks for any help.