title: Sending big packets gets Bad Address error
body: <p>Im writing a live webcam stream using ffmpeg and sdl on C. <br>
  my platform is linux.</p>
  
  <p>my application is a client server based. <br>
  The client is reading from the webcam, produce an AVPacket, then send to server.</p>
  
  <p>My problem is, that the AVPacket struct has a member named data which is approximately 600k.<br>
  At first, i had not checked the send() return value, <br>
  So, of course the packet had failed to send completely.</p>
  
  <p>But after I checked, the send() returns Bad Address error at the second iteration of the big packet. <br>
  the length of the data packet must be correct because is supplied from the AVPacket struct.</p>
  
  <p>It sends 2 members of the AVPacket before, so the server is up and functional.</p>
  
  <p>The problematic section:</p>
  
  <pre><code>    int send_video_data(video_client_t *client, void* buf, int length)
      {
          int rc;
  
          while (length &gt; 0)
          {
             if ((rc = send(client-&gt;sockfd, buf, length, 0)) == -1) {
                       perror("failed sending data to server");
                       exit(1);
              }
  
              length-=rc;
              buf+=rc;
          }
  
          return 0;
  
      }
  </code></pre>
  
  <p>Any one got any ideas why it's not working? <br>
  Thanks in advanced!</p>