端口是对的,我只想知道Android端用什么样的方法可以接收,比如Datainputstream....

解决方案 »

  1.   

      InputStream inputStream = socket.getInputStream();从inputStream 里面不停的读取数据就可以了 reciveBuffer = new byte[1024];
                    int a = inputStream.read(reciveBuffer);
    //                 inputStream.r
                    if(a !=-1 && mMessageCache.get(this.tcpID)!=null){
                     byte []reciveB = new byte [a];
                     System.arraycopy(reciveBuffer, 0, reciveB, 0, a);
    }