(byte)0,
(byte)0),
out);
}
final ConnectionHandler handler = new ConnectionHandler(conn);
conn.setFrameOutputHandler(out);
final URI uri = new URI(_transport +"://"+ address+":"+ port +"/");
WebSocket.Connection connection = client.open(uri, new WebSocket.OnBinaryMessage()
{
public void onOpen(Connection connection)
{
Thread outputThread = new Thread(new FrameOutputThread(connection, src, conn, exceptionHandler, webSocketClientFactory));
outputThread.setDaemon(true);
outputThread.start();
}
public void onClose(int closeCode, String message)
{
conn.inputClosed();
}
@Override
public void onMessage(final byte[] data, final int offset, final int length)
{
handler.parse(ByteBuffer.wrap(data,offset,length).slice());
}
}).get(5, TimeUnit.SECONDS);
}
catch (Exception e)
{