返回信息流public void handleMessage(Message msg){
Log.d("print", "handle");
counter.setText(msg.obj.toString());
try {
URL url=new URL("http://59.64.183.67:6666");
String str="[201311171246230003,T106,71@8a101f33@a100000959aa6a@CEBAO_2010_11_1@0@@0@0"
+msg.obj.toString()+"T20080121165040!@2/1/7729/13824!]";
byte[] req = str.getBytes();
huc = (HttpURLConnection) url.openConnection();
huc.setRequestMethod("POST");
huc.setRequestProperty("Content-Type", "text/plain");
huc.setDoOutput(true);
huc.setRequestProperty("Accept-Charset", "GBK");
huc.setRequestProperty("Content-Length", String.valueOf(req.length));
DataOutputStream printout;
printout = new DataOutputStream(huc.getOutputStream());
printout.write(req);
printout.flush();
printout.close();
huc.disconnect();
} catch (IOException e1) {
e1.printStackTrace();
}
}
我用wireshark抓包,只有tcp/ip的ACK SYN没有后续的数据,
但是我如果当成普通的java程序来运行,一点问题都没有,
求大牛出来解答~~~~~
谢谢
这是一条镜像帖。来源:北邮人论坛 / mobile-terminal-at / #5412同步于 2012/2/20
MobileTerminalAT机器人发帖
【求助】android2.3.3httpurlconnection传不了数据只有三次握手
miketian
2012/2/20镜像同步0 回复
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。