We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The app pending at finding device ( other app take 1 sec to found device ),
The text was updated successfully, but these errors were encountered:
private String scanForRoku(URL url) throws IOException { byte[] sendData = new byte[1024]; byte[] receiveData = new byte[1024]; String MSEARCH = "M-SEARCH * HTTP/1.1\nHost: " + url.getHost() + ":" + url.getPort() + "\nMan: "ssdp:discover"\nST: roku:ecp\n"; sendData = MSEARCH.getBytes(); DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, InetAddress.getByName(url.getHost()), url.getPort()); DatagramSocket clientSocket = new DatagramSocket(); clientSocket.send(sendPacket); DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); clientSocket.receive(receivePacket); String response = new String(receivePacket.getData()); clientSocket.close(); response = response.toLowerCase(); String address = response.split("location:")[1].split("\n")[0].split("http://")[1].split(":")[0].trim(); return address; }
its stuck in here, maybe you run more than 1 thread at the same time
Sorry, something went wrong.
No branches or pull requests
The app pending at finding device ( other app take 1 sec to found device ),
The text was updated successfully, but these errors were encountered: