爆出异常;java.net.SocketException: Software caused connection abort: recv failed代码如下:
    public byte[] getRecord(InputStream  inputStream,String simid)
    {               
        byte[] singleByte = new byte[1];           
        int i=0;           
        try
        {
        while ((inputStream.read(singleByte)) != -1)   
        {
            int tmp = Utils.toInt(singleByte[0]);       
           
                       
        }
        return new byte[]{0x00};
        }
        catch(Exception ex)
        {
            System.out.println(ex.getMessage());   
            return new byte[]{0x00};
        }
    }        socketClient = new Socket("***.***.***.***",9100);
            output = socketClient.getOutputStream();
            output.write(LoginData);
            output.write(sendBytes);
           
            is = socketClient.getInputStream();
            GpsSocket gsIns = new GpsSocket();
            byte[] set = gsIns.getRecord(is,tmp[0]);我已经通过Google 搜索N次,相关url
http://forum.java.sun.com/thread.jspa?threadID=430179&messageID=4429682
http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.sqlserver.jdbcdriver&cat=en_US_22326e25-7529-45bb-a7af-96ec8a2601d7&lang=en&cr=US&sloc=&p=1&mid=e16de076-5fda-4ddb-9386-14f3ce2e1dfc&tid=e16de076-5fda-4ddb-9386-14f3ce2e1dfc目前问题还没有解决,不知道因为什么
!谢谢大家!@

解决方案 »

  1.   

    应该不会!
    端口冲突的话,socket不能连接我现在可以连接,可以写数据,但是不能接收数据
      

  2.   


    答:应该是程序的问题。
    你将代码:is = socketClient.getInputStream(); 放到:output = socketClient.getOutputStream(); 之后及 output.write(LoginData); 之前。以上仅供你参考。