Well, i failed, and google failed. Maybe i switched to the stream_ function set even earlier. To me, it seems the socket extension for php4 simply isn't finished, and with things being so incredibly simple in php5, it's absolutely not worth the hassle.
So, switch to php5 or install a separate cli-only php5 to use for this, because while there might be a magic trick to get it somewhat working under php4, comparing the amount of work involved under php4 to the amount of work under php5, using php4 seems like a really bad idea. Even if you're trying to run it under a webserver where you for some reason really don't want to switch php versions--and wan't short bursts of data off insim, running an exec or system call to a php5-cli would be less work, and you'd have the output in php4 thru stdout.
I do know for sure that i've been playing with sockets in php4, probably TCP, and had those non-blocking errors, another problem completely solved by php5.