为什么在我对socket进行编程的时候会抛出
SocketException 并且提示:Softwere caused connection abort:socket writer error!
麻烦各位大哥了~

解决方案 »

  1.   

    你给的错误,我只能知道连接中断了,写socket错误。给源码,指出调试到哪行报错~
      

  2.   

    OK好的这是代码:
         File file = new File(getFileFrom());
         FileInputStream fileInput = new FileInputStream(file);
         dataInput =new DataInputStream(fileInput);
         socket = new Socket(getFileTo(),getPort());
         dataOutput = socket.getOutputStream();
         byte[] data = new byte[fileInput.available()];
         dataInput.read(data);
         dataOutput.write(data);//这一行出错
      

  3.   

    我用另外一种方式
    int i;
    while((i=fileInput.read())!=-1){
       dataOutput.write(i);
    }
    也会报错