s = new Socket(InetAddress.getByName(server_address), server_port);
out = new PrintWriter(s.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(s.getInputStream()));
...
out.println("DESCRIBE " + url + " RTSP/1.0");
out.println("CSeq: 1");
out.println("");
String answer = null;
try {
answer = in.readLine();
...
If it happen in java project all good and we get answer like "RTSP/1.0 200 OK\n", but if I run same code on android I haven't any response. Why?
-
Any exceptions shown in logcat?nhaarman– nhaarman2012年02月14日 16:48:02 +00:00Commented Feb 14, 2012 at 16:48
-
No, logcat haven't any exceptionrebel_UA– rebel_UA2012年02月15日 08:51:51 +00:00Commented Feb 15, 2012 at 8:51
2 Answers 2
Also println() isn't good enough. You have to send exactly \r\n as line terminators for most Internet protocols, not whatever your local system's line terminator is.
answered Feb 15, 2012 at 1:26
user207421
312k45 gold badges324 silver badges493 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-java