Develop websocket client

I’m trying to develop a websocket client for android here I leave my code but when I try to preview it throws error.

[javac] Path/to/Archive Line of “try {”: error: cannot find symbol

[javac] Path/to/Archive Line of “e.printStackTrace();”: error: cannot find symbol

[javac] Path/to/Archive Line of “@Override”: error: cannot find symbol

[javac] Path/to/Archive Line of “@}”: error: cannot find symbol

Please help me.

[Require("org.java-websocket","Java-WebSocket:1.3.0")]
[Foreign(Language.Java)]
static extern(Android) void ConnectWebsocket()
@{
	URI uri;
  	try {
    	uri = new URI("ws://host:port");
  	} catch (URISyntaxException e) {
	    e.printStackTrace();
	    return;
  	}

	mWebSocketClient = new WebSocketClient(uri) {
	    @Override
	    public void onOpen(ServerHandshake serverHandshake) {
	    	debug_log("Websocket Opened");
	    }

	    @Override
	    public void onMessage(String s) {
	      	final String message = s;
	      	debug_log("Websocket" + message);
	    }

	    @Override
	    public void onClose(int i, String s, boolean b) {
	      	debug_log("Websocket Closed " + s);
	    }

	    @Override
	    public void onError(Exception e) {
	      	debug_log("Websocket Error " + e.getMessage());
	    }
  	};
  	mWebSocketClient.connect();
@}

This is the site that I use for reference https://www.varvet.com/blog/using-websockets-in-native-ios-and-android-apps/

Hi!

You are getting compile errors from the java compiler. My guess is that you are missing some imports. Try compiling with -vv set for verbose output, maybe the java compiler gives some more info then

WebSockets are ready internally, so it will probably end up public in the relase right after Christmas.

Thanks to both, and I will follow your recommendations Anders, I will wait for the release of the websocket natively, thank you.