If the socket is not connected, writing to it will return an error which you can then check. Usually, writing to a socket has a timeout which you cannot avoid due to the nature of TCP.
Personally, I would look at AnyEvent or one of the other frameworks to handle non-blocking sockets.
Maybe you can tell us what solutions you have looked at and where you have problems with them? If you want to roll your own solution, perlipc provides a good starting point IMO.
In reply to Re^5: Check connection state prior to send data
by Corion
in thread Check connection state prior to send data
by Lucas Rey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |