Thread: Sending data over the network

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    29

    Sending data over the network

    What is the maximum number of bytes that the server can pass to the client over the network per second ? Thanks

  2. #2
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    The short answer is it depends.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    29
    Can you give me an avrage number of bytes per second ? Depends on What ?

  4. #4
    Novice
    Join Date
    Jul 2009
    Posts
    568
    HP or IBM swallow, err, server?
    Disclaimer: This post shows my ignorance at the time of its making. I claim ownership of but not responsibility for all errors in it. Reference at your own peril.

  5. #5
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    It depends on the hardware configuration and operating systems (more accurately, their implementation of networking) of the machines that host the client and the server. It also depends on the networking hardware, and various attributes of the networking cabling (type [coax, fibre optic, twistered pair, etc], length, quality, etc) as well as attributes of other networking devices between client and server (wireless devices, repeaters, hubs, bridges, switches, ....).

    All of those things are quite variable, to say the least. So your question is meaningless.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  6. #6
    Registered User
    Join Date
    Mar 2012
    Posts
    29
    I am using ARN microprocessor and Linux OS. as well i am using TCP sockets both client and server.Can you give me addlist an avrage number of bytes per second ?The madia is cables

  7. #7
    Novice
    Join Date
    Jul 2009
    Posts
    568
    Vote to close.
    Disclaimer: This post shows my ignorance at the time of its making. I claim ownership of but not responsibility for all errors in it. Reference at your own peril.

  8. #8
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by codewriter View Post
    What is the maximum number of bytes that the server can pass to the client over the network per second ?
    ...later...
    Quote Originally Posted by codewriter View Post
    Can you give me an avrage number of bytes per second?
    What are you actually asking? The answer to both is it depends. In fact, the very fact that you need this kind of information for your design stinks to high heaven. Furthermore, what does this have to do with C whatsoever?
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  9. #9
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    The entire thread might as well be asking "How fast is a car?".

    Without any specific details, specifically pertaining to hardware of the client, the server, and any link between, your question is impossible to answer. If you're trying to optimize network throughput in your program, usually this is fruitless anyway. The delay is almost invariably caused by something out of your control, such as the ISP.

  10. #10
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Average Speed 100mbs
    Standard Deviation 1000mbs

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    First you look at the network cards plugged into (or built onto the motherboard) of each device, and work out whether it's a 10Mb or 100Mb (or if you're really lucky 1000Mb) capable NIC.

    Then you look at each router / switch / hub/ between them, and work out what they're rated at as well.
    The network speed will be the lowest number you find.

    Then you look at the general quality of all your cables along the route to try and estimate how reliable the link is at the physical level, to try and guess how much retrying is going on to form a reliable TCP connection. Try sending a lot of UDP packets and see how many arrive.

    Next you try and estimate what the background network activity is for other processes on your machine(s) and other machine(s) on the network.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sending data to a server
    By Hakins90 in forum Networking/Device Communication
    Replies: 6
    Last Post: 04-16-2008, 07:54 AM
  2. Sending data over the internet
    By turck3 in forum C++ Programming
    Replies: 2
    Last Post: 02-27-2008, 06:30 PM
  3. Sending structures through the network
    By Mortissus in forum C Programming
    Replies: 3
    Last Post: 07-26-2007, 10:24 AM
  4. Replies: 6
    Last Post: 06-11-2005, 04:10 AM
  5. Sending data packets
    By neandrake in forum Networking/Device Communication
    Replies: 6
    Last Post: 11-26-2003, 01:41 PM