android connect supersocket

Apr 24, 2014 at 6:18 AM
Edited Apr 24, 2014 at 6:22 AM
Hi,all,
 I try to connect supersocket's server on android 2.2. The socket can connect the server, but when I send data, the server cann't get data.The telnet test is ok!
the code like this:
PrintStream output = new PrintStream(client.getOutputStream(), true, "utf-8");
output.println(command);
output.flush();
or
BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(client.getOutputStream()));
bufferedWriter.write(s);
bufferedWriter.newLine();
bufferedWriter.flush();
How to fix it?
thanks!
Coordinator
Apr 24, 2014 at 6:47 AM
Did you check the log of server side?

I am not sure "bufferedWriter.newLine();" means append("\r\n").

Anyway, the SuperSocket's default command protocol only accept the data which end with "\r\n".
Marked as answer by mazelin on 4/24/2014 at 2:55 AM
Apr 24, 2014 at 10:54 AM
It's ok! must append("\r\n").
thank you!