关于http协议
为什么 我的客户端有时候下载成功,有时候失败呢?客户端为 android浏览器
服务器端 为 serversocket 写的监听
下面上部分服务器端代码 求大神解惑。
System.out.println(filePath + " requested.");
outstream.println("HTTP/1.1 200 OK");
outstream.println("MIME-version:1.0");
// outstream.println("Content_Type:text/html");
outstream.println("Content-Type:application/octet-stream");
int len = (int) file.length();
// outstream.println("Location:" + filePath);
outstream.println("Content-Length:" + len);
Log.d(TAG, "len: " + len);
// outstream.println("Connection:close");
// outstream.println("Accept-Ranges:bytes");
outstream.println("");
sendPPt(outstream, filePath);
// outstream.println("");
outstream.flush();
补充:移动开发 , Android