I worked around it by using a regular socket and running the script to ignore user abort. To handle input and output, I used a mysql database.
example:
user wants to connect host1.
script connects to host1 through page1.php
user is redirected via javascript with a document.location='page2.php' after the connection has been established. the script keeps running until stopped by an exit() command or the webserver is restarted. this is done much like the daemons you will see others writing.
page1 then continues running and looks at the database field 'send' every second and then sends data through the socket when there is something there.. and then empties the field once the data is sent.
page1 also takes any data received through the socket and places in the database field 'receive'.
page2 then displays the entire contents of the receive field to the user and uses the same javascript above to reload the page after 8 or so seconds. this continues until no needed (you decide).
page3 (which is viewed at the same time as
page2, but in a different frame) allows the user to enter text to send. When submitted, it adds the text to the 'send' field of the database mentioned above.
this is the basic idea that i used to implement an IRC client. a buddy has given me a saying that sticks with me in a lot of things like this that i write: "It's ghetto, but it works". It does work but also is a major hack around php's inabilities.
let me know how your script goes if you decide to use this method. feel free to email me if you have any questions.