I've got a piece of socket code that sometimes takes forever to run, way beyond my attention span.
I looked into timeouts, also the timeout function for sockets is bad and pretty much doesn't do anything and is a waste of bytes, but I found that Alarm was a way to timeout a scetion of code, the documentation is so fuzzy on this and don't give any cut & paste type examples that I usually have more success with. Does anyone know how to use the alarm(); function to make sure a section of code doesn't run for more than say 2 seconds?
Thanks
Tony "Java?? Umm, I think that's the stuff I drink while I'm coding perl."
I looked into timeouts, also the timeout function for sockets is bad and pretty much doesn't do anything and is a waste of bytes, but I found that Alarm was a way to timeout a scetion of code, the documentation is so fuzzy on this and don't give any cut & paste type examples that I usually have more success with. Does anyone know how to use the alarm(); function to make sure a section of code doesn't run for more than say 2 seconds?
Thanks
Tony "Java?? Umm, I think that's the stuff I drink while I'm coding perl."