in reply to Re: Timeouts when reading from socket Filehandles?
in thread Timeouts when reading from socket Filehandles?

If that does not offer exactly what you are looking for, what I have always done (in other languages, never had to do sockets with perl) was create a thread to handle the information. Attach a buffer and every now and again read the buffer to see what is in it from your main loop. This assumes you have thread support compiled into your version of perl (My Admin at work is doing this very thing right now to solve a similar problem)
  • Comment on Re: Timeouts when reading from socket Filehandles?

Replies are listed 'Best First'.
Re^2: Timeouts when reading from socket Filehandles?
by tadman (Prior) on Aug 27, 2002 at 12:34 UTC
    Although threads are fun, using a thread to manage a socket is overkill. You can do just fine using IO::Select and a single process. UNIX people have been writing single-process socket handling applications for years, and they work very well.

    The problem with introducing threads is that you have to make sure your code is thread safe. As soon as you put two trains on the metaphorical track of your program, you're going to have to make sure you're not setting yourself up for disaster.