class MySocketClient extends WebSocketClient { String serverResponse; public void onMessage( String message ) { serverResponse = message; } } class A { public String f () { MySocketClient c = new MySocketClient( new URI(...)); c.connect(); c.send("request"); return c.serverResponse; // I see null here because this line is executed before the line from onMessage method } }
onMessage
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)