Find the answer to your Linux question:
Results 1 to 6 of 6
How to receive larger data than 1460 bytes from any browser for eg. Mozilla,chrome etc, using sockets API.I tried using recv() in loop but it receives once and hangs on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2012
    Location
    Bangalore,India
    Posts
    9

    How to receive larger data than 1460 bytes from any browser.


    How to receive larger data than 1460 bytes from any browser for eg. Mozilla,chrome etc, using sockets API.I tried using recv()
    in loop but it receives once and hangs on the recv() call again.So i am able to receive only 1460 bytes of data only where i need to get POST HTTP data of content length 4000 or more.I am using C for programming using Linux socket APIs.I need it urgently please help me.Thanks in advance.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,691
    TCP/IP packet size is limited to 1460 (more or less) bytes. Local networks can enable big packets to increase that, but it generally won't work across the Internet. This enables the reliability of TCP/IP over many hops and using different routes. One packet can be "lost" (dropped, corrupted, whatever), and only that packet needs to be resent to restore the stream. If you are using big packets, then reliability and recovery become much more difficult issues when running on what are fundamentally unreliable networks.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Aug 2012
    Location
    Bangalore,India
    Posts
    9
    But then how a browser is able to send large packets to any server when we click a submit POST request?In that case also it has to send larger packets across the internet to server.Then how the sever receives that packets?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,691
    The TCP/IP stack breaks up bigger messages into packet-sized chunks and sends each separately. They are reassembled at the receiving end, even if they are received out of order (not an uncommon situation).
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Aug 2012
    Location
    Bangalore,India
    Posts
    9
    So how can i collect all the data send in chunks on the server side? Isn't there any way to receive the data send from any browser more than 1460 bytes???

  7. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,691
    This is a tcp/ip issue. You can send as many bytes as you want, and your server at the other end should be able to read the entire message; however, down at the transport layer of the tcp/ip protocol stack, all messages are broken up into standard size packets (max about 1500 bytes including headers). If this is still not making sense to you, then go read this wikipedia article about the tcp/ip protocol: Transmission Control Protocol - Wikipedia, the free encyclopedia
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •