in reply to Socket Keep Alive

As talexb said, a bit more background info on how you've set up your streaming server would help.

As to 'KeepAlive': this is something usually negotiated at a higher level (and AFAIK, not a valid option to IO::Socket::INET). For example, a browser and a webserver can agree on keeping their HTTP connection alive over multiple requests. But as soon as one side closes the socket, it's closed (i.e. no longer 'alive'). And that's exactly what you're doing in the code snippet you posted...

Replies are listed 'Best First'.
Re^2: Socket Keep Alive
by Anonymous Monk on Sep 18, 2007 at 10:40 UTC
    Hello again, sorry for the first incomprensible question. I will try to make it clearer:

    basically I am running a peer 2 peer tv application that creates a web server on the 'localhost'. To this a media player connects in order to retrieve the streaming. If at the same time I connect my perl application to the 'localhost' I can also retrieve the data. So far so good!

    Now the problem arises when I want to keep a persistant connection to 'localhost' from my perl application in order to 'sniff' the data, even when my p2p app changes channels (meaning opens a new connection on the same port at localhost).

    With the code I showed you what happen is that both applications crash.

    Do you have any idea on how to build the application in order to have a persistant connection allowing also my p2p app to connect to that same port and work properly?

    Hope you can help and thanks for your patience.