use of streamer.SocketWrapperImpl in project cloudstack by apache.
the class Client method runClient.
public void runClient(String[] args) {
try {
Protocol protocol = parseOptions(args);
if (protocol == Protocol.NONE)
return;
System.setProperty("streamer.Link.debug", "" + debugLink.used);
System.setProperty("streamer.Element.debug", "" + debugElement.used);
System.setProperty("streamer.Pipeline.debug", "" + debugPipeline.used);
SSLState sslState = new SSLState();
// Create socket wrapper
if ("jre".equals(sslImplementation.value)) {
socket = new SocketWrapperImpl("socket", sslState);
} else if ("apr".equals(sslImplementation.value)) {
socket = new AprSocketWrapperImpl("socket", sslState);
} else if ("bco".equals(sslImplementation.value)) {
socket = new BcoSocketWrapperImpl("socket", sslState);
} else {
throw new RuntimeException("Unexpected option value: \"" + sslImplementation.value + "\". " + sslImplementation.help());
}
screen = new ScreenDescription();
canvas = new BufferedImageCanvas(canvasWidth.value, canvasHeight.value);
screen.addSizeChangeListener(new SizeChangeListener() {
@Override
public void sizeChanged(int width, int height) {
if (canvas != null) {
canvas.setCanvasSize(width, height);
if (scroller != null)
scroller.setSize(canvas.getWidth(), canvas.getHeight());
}
}
});
assemblePipeline(setMainElementAndAddressBasedOnProtocol(protocol, sslState));
frame = createVncClientMainWindow(canvas, protocol.toString() + " " + hostName.value, new WindowAdapter() {
@Override
public void windowClosing(WindowEvent evt) {
shutdown();
}
});
try {
// Connect socket to remote server and run main loop(s)
socket.connect(address);
} finally {
shutdown();
}
} catch (Exception e) {
e.printStackTrace(System.err);
}
}
Aggregations