title: Is there some difference between parsing network and parsing a file?
body: <p>I am writing a tool to dump redis 's rdb data file. I send a 'sync' command the save as a slave. and then parse the rdb to keys,values.
  However, I can not parse the rdb when directly read from the network. It works well when I write the network data to a file and pares the file instead . I don't know why . The code parse the network and the file is completely same.
  Is there some difference between parsing network and parsing a file ?</p>
  
  <p>Thanks !</p>
  
  <p>----------------update------------------<br>
  Problem solved:<br>
  It's my fault , I do not familiar with network programming. I used read system call in a wrong way.<br>
  For example:<br>
  I want read SIZE bytes from network,I wrote:<br>
  <code>nread = read(fd,buf,SIZE)</code><br>
  I assumed that the nread is equal to SIZE . This works well for reading file at the most of time but does not work when reading net stream at most of time.
  So I use syncRead in redis replication.c instead.<br>
  Thanks all of you for helping me  solving the problem !</p>