2015-10-29, 13:47
Hi,
I was wondering how/where the data is "returned" in response to a JSON-RPC (via TCP) method? I have managed to call a method successfully in my crummy java program:
But I don't see any "return" data in the outputstream of the "client" socket. This may not be relevant to Kodi in general, but thought I'd ask for help anyway. I'm very new to programming, so the simpler the better!
Thanks
Edit: rest of code:
I was wondering how/where the data is "returned" in response to a JSON-RPC (via TCP) method? I have managed to call a method successfully in my crummy java program:
Code:
JSONObject js = new JSONObject();
js.put("jsonrpc", "2.0");
js.put("method", "Input.Back");
Socket client = new Socket(hostname, port)
Writer w = new OutputStreamWriter(client.getOutputStream());
js.write(w);
w.flush();
But I don't see any "return" data in the outputstream of the "client" socket. This may not be relevant to Kodi in general, but thought I'd ask for help anyway. I'm very new to programming, so the simpler the better!
Thanks
Edit: rest of code:
Code:
BufferedReader in = new BufferedReader(new InputStreamReader(client.getInputStream()));
String x;
while ((x = in.readLine()) != null) {
System.out.println(x);
}