Greetings
After some time banging my head to a wall (and much more time reading through previous posts such as this one I have come to some discoveries that bring yet more questions regarding the message passing daemon that I am writing :
- a continuous write such has my sub{my $c = 0; while(1){$sock->print("$c\n");$c++}} quickly ends up with the remote end hanging up
- same write with a sleep in each loop works fine
- this does not seem to happen with simple named pipe, but if I fill a named pipe without a reader on the other end I quickly fill my ram with crap(or more accurately whatever I did put in the named pipe
- SOCK_STREAM seems fine for text line but what about serialized data?
I have tested my code using the following combination:
- named pipe input, named pipe output : no issue with a loop without sleep
- unix_socket input, named pipe output : the issue I talk about
Now, after some debugging I discovered that my testing program crashed when the connection was reset by the peer, is there anyway to reconnect to an unix socket after the connection has been reset and do so without crashing?
or should I just take care of not sending to much data at the same time?
And last but not least, since I am going to use that message passing daemon to carry serialized objects around is SOCK_STREAM a bad idea?