uri = new URI(uriString);
} catch (URISyntaxException e) {
throw new WebSocketException("Error parsing WebSocket URL:" + uriString, e);
}
this.url = uri;
handshake = new WebSocketHandshake(url);
try {
socket = createSocket();
input = socket.getInputStream();
output = new PrintStream(socket.getOutputStream());