title: socket in dart can not get response from server
body: <p>I used client in dart and server in java netty to send an object with flatbuffer protocol , the problem is server can get data but when server send data to client dart then nothing happen in socket listen
  dart code :</p>
  <pre><code>Future&lt;void&gt; main() async {
    await Socket.connect(&quot;192.168.1.187&quot;, 8080).then((Socket sock) {
      socket = sock;
      print(&quot;connect to host &quot;);
      socket.listen(dataHandler,onError: errorHandler, onDone: doneHandler, cancelOnError: false);
    }).catchError((Object e) {
      print(&quot;Unable to connect: $e&quot;);
    });
  var data = PlayerPositionObjectBuilder(playerId: 1, y: 1, x: 1, direction: 'right', time: '111').toBytes();
        sendData(data);
    
        stdin.listen((data) =&gt; (data) {
              print(&quot;get data&quot;);
            });
      }
  
  void dataHandler(data) {
    print('get data from server !!');
    //print(new String.fromCharCodes(data).trim());
  }
  
  void sendData(Uint8List data) {
    socket.write(data);
  }
  
  void errorHandler(error, StackTrace trace) {
    print(error);
  }
  
  void doneHandler() {
    socket.destroy();
  }
  </code></pre>
  <p>java server i'm using netty java with handler :</p>
  <pre><code>public class MapHandler extends ChannelInboundHandlerAdapter {
  
   @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
      cause.printStackTrace();
      ctx.close();
    }
  
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
      ByteBuf byteBuf = (ByteBuf) msg;
      int length = byteBuf.readableBytes();
      byte[] bytes = new byte[ length ];
  
      byteBuf.readBytes(bytes);
  
      ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
     // PlayerPosition playerPosition = PlayerPosition.getRootAsPlayerPosition(byteBuffer);
      System.out.println(&quot;tọa độ người chơi :&quot;);
      sendPlayerPosition(ctx,1,1,2,&quot;right&quot;,&quot;11111&quot;);
      //super.channelRead(ctx, msg);
    }
  
    void sendPlayerPosition(ChannelHandlerContext channelHandlerContext, int playerId, double positionX, double positionY, String direction, String time) {
      FlatBufferBuilder builder = new FlatBufferBuilder();
      int directionOffset = builder.createString(direction);
      int timeOffset = builder.createString(time);
      int playerPositionOffset = PlayerPosition.createPlayerPosition(builder, playerId, positionX, positionY, directionOffset, timeOffset);
      builder.finish(playerPositionOffset);
      byte[] data = builder.sizedByteArray();
      channelHandlerContext.writeAndFlush(data);
    }
  </code></pre>
  <p>}</p>