title: Send Picture by socket (send func) in c++ , but do not recive complete(Windows)!
body: <p>I am sending data from client to server,But picture do not receive complete.</p>
  
  <p>Client Code: </p>
  
  <pre><code>FILE *fr = fopen(tmppicsend, "rb");
  char* buffer;
  buffer = (char*) malloc(sizeof(char)*size);
  fread(buffer, size, 1, fr);
  send_len_pic = send( m_socket_pic, buffer, size, 0 );
  recv( m_socket_pic, rec_end_check, 32, 0 );
  fclose(fr);
  free(buffer);
  </code></pre>
  
  <p>Server Code:</p>
  
  <pre><code>FILE *fw = fopen(fname, "wb");
  char* buffer;
  buffer = (char*) malloc(sizeof(char)*size);
  int rec_len = recv( current_client, buffer, size, 0 );
  buffer[size]='\0';
  fwrite(buffer, size, 1, fw);
  size -= size;
  free(buffer);
  fclose(fw);
  </code></pre>
  
  <p>Config Socket:</p>
  
  <pre><code>WSADATA wsaData_pic;
  SOCKET m_socket_pic;
  SOCKET m_backup_pic;
  sockaddr_in con_pic;
  
   // Initialize Winsock.
  int iResult = WSAStartup( MAKEWORD(2,2), &amp;wsaData_pic );
  if ( iResult != NO_ERROR ){
      //printf("Error at WSAStartup()\n");
  }
  // Create a socket.
  m_socket_pic = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP );
  
  if ( m_socket_pic == INVALID_SOCKET ) {
      //printf( "Error at socket(): %ld\n", WSAGetLastError() );
      //WSACleanup();
  }
  
  m_backup_pic = m_socket_pic;
  
  // Connect to a server.
  con_pic.sin_family = AF_INET;
  con_pic.sin_addr.s_addr = inet_addr( ip );
  con_pic.sin_port = htons( 2200 );
  
  if ( connect( m_backup_pic, (SOCKADDR*) &amp;con_pic, sizeof(con_pic) ) == SOCKET_ERROR) {
      //printf( "Failed to connect.\n" );
      //WSACleanup();
  }else
  {   
      m_socket_pic=m_backup_pic;
  }
  
  
  }
  </code></pre>
  
  <p>When I'm comparing this pictures, i see error in sequence number packet(packets do not receive regularly ).
  Picture(Pic from Client and Server) were the same size.
  I want to send JPEG picture.</p>
  
  <p>Please Help me, tanks.</p>