大家好,
小弟要做tcp 的连线传值,android端是client
new Thread(new Runnable(){
@Override
public void run() {
try {
// XXX.XXX.XXX.XXX = server ip , xxxx = port
Socket socket = new Socket("xxx.xxx.xxx.xxx", xxxx);
try {
DataOutputStream out;
out = new DataOutputStream(socket.getOutputStream());
// msg = String "xxx";
out.write(msg.getBytes());
out.flush();
out.close();
}
catch (Exception e) {
e.printStackTrace();
}
finally {
socket.close();
}
}
catch (InterruptedException e) {
e.printStackTrace()
}
}).start();
此段就是android传送值的内容,连续传送到server端后,会造成server端crash
怎么想都想不出原因,是否有大大可以指点。
感恩蛤