0
FileOutputStream fos = new FileOutputStream(fileName);
InputStream is = clientSocket.getInputStream();
while ((readBytes = is.read()) != -1)
{
fos.write(readBytes);
System.err.println(readBytes);
}
System.err.println(readBytes);
clientSocket.shutdownOutput();
fos.close();
System.out.println("Trans complete");
客戶端發送-1,但服務器無法接收-1服務器無法接收EOF在Java
我怎樣才能得到所有的文件?
你的服務器代碼在哪裏? – 2012-11-09 10:21:59
什麼是clientSocket? – PeterMmm
你怎麼知道客戶端發送-1? – m0skit0