austgl / phpws

Automatically exported from code.google.com/p/phpws
0 stars 0 forks source link

missing function removeUriHandler in websocket.server.php #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I hope this the right place to post this. But im sorely missing the ability to 
remove an uri handler at runtime.

What version of the product are you using? On what operating system?
1.0RC, linux

Please provide any additional information below.

filename : websocket.server.php
class : WebSocketServer

/**
 * Unassociate a request uri to a IWebSocketResourceHandler.
 *
 * @param string $script For example 'handler1' to capture request with URI '/handler1/'
 * @param $disconnectUsers if true, disconnect users assosiated to handler.
 */
public function removeUriHandler($script, $disconnectUsers = true){

    if ( empty($this->uriHandlers[$script]) ) return false;
    $handler = $this->uriHandlers[$script];
    unset( $this->uriHandlers[$script] );

    if ($disconnectUsers) foreach($handler->getConnections() as $user){

        $handler->removeConnection($user);
        $user->disconnect();
    }

    return $handler;
}

Original issue reported on code.google.com by nox...@gmail.com on 20 Feb 2012 at 2:48

GoogleCodeExporter commented 9 years ago
Thanks for this addition. Will add it to the code base now :)

Original comment by ch...@devristo.com on 25 Feb 2012 at 9:32

GoogleCodeExporter commented 9 years ago

Original comment by ch...@devristo.com on 21 May 2012 at 6:24