public LinkConnection open(Broker broker)
{
try {
HmtpWebSocketListener webSocketHandler = new HmtpWebSocketListener(broker);
WebSocketClient oldClient = _webSocketClient;
_webSocketClient = new WebSocketClient(_url, webSocketHandler);
if (oldClient != null) {
oldClient.close();
}
if (_virtualHost != null)
_webSocketClient.setVirtualHost(_virtualHost);