Let me explain, I don't want that you (or other users) write the code for me, but before post to perlmonks I search around the net. So, I'm here because I cannot find anything. :-)
What you link is an interesting start point, but I already checked these pages without find a solution to my issue! ;)
| [reply] |
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.
| [reply] |
Could you please tell me how intercept the error coming from socket? Because I tried, the following:
...
OpenSocket();
sleep(5);
$str="Something to send";
$sock1->send($str);
Then, during sleep I disconnect acting on server. When the application try to send the message, it exit from execution without print anything. | [reply] [d/l] |
| [reply] [d/l] |
Ok, maybe I don't understand how the IO::Select works. :(
Could you please post an example on how I can implement it? Thank you!!
| [reply] |