Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. how to determine max TCP/IP send size

how to determine max TCP/IP send size

Scheduled Pinned Locked Moved ATL / WTL / STL
sysadmincsharpc++visual-studiocom
5 Posts 3 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bkelly13
    wrote on last edited by
    #1

    Windows 7, Visual Studio 2010, C++ How can an application determine the maximum size for a single chunk of data to be sent from a server application to a client application on another computer? This is on a private network, not not accessible outside of the control room. There is a switch between the two computers but that is about it. I presume this can be done a run time. My application sends large amounts of telemetry data to a client for display. The goal is to reduce buffering as much as possible. The app uses overlapped I/O with completion events.

    Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

    L A 2 Replies Last reply
    0
    • B bkelly13

      Windows 7, Visual Studio 2010, C++ How can an application determine the maximum size for a single chunk of data to be sent from a server application to a client application on another computer? This is on a private network, not not accessible outside of the control room. There is a switch between the two computers but that is about it. I presume this can be done a run time. My application sends large amounts of telemetry data to a client for display. The goal is to reduce buffering as much as possible. The app uses overlapped I/O with completion events.

      Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      See https://www.google.com/search?q=tcp%2Fip%20buffer%20size[^].

      B 1 Reply Last reply
      0
      • L Lost User

        See https://www.google.com/search?q=tcp%2Fip%20buffer%20size[^].

        B Offline
        B Offline
        bkelly13
        wrote on last edited by
        #3

        I am getting back to my application that ingests telemetry data and sends it to a display device. There will be a lot of data and a lot of packets. The data to the display device will be about 4.5 megabytes per second per stream. I think I need the program to have the ability determine the MSS and MTU so it can build the buffers and get them out in the most efficient manner possible. I would prefer for the app to get this data on the fly rather than hard code numbers into the app. I have seen all those links via my search but nothing tells me how to get these values via code, c++ code specifically.

        Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

        L 1 Reply Last reply
        0
        • B bkelly13

          I am getting back to my application that ingests telemetry data and sends it to a display device. There will be a lot of data and a lot of packets. The data to the display device will be about 4.5 megabytes per second per stream. I think I need the program to have the ability determine the MSS and MTU so it can build the buffers and get them out in the most efficient manner possible. I would prefer for the app to get this data on the fly rather than hard code numbers into the app. I have seen all those links via my search but nothing tells me how to get these values via code, c++ code specifically.

          Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          See https://msdn.microsoft.com/en-us/library/windows/desktop/ms738544(v=vs.85).aspx[^].

          1 Reply Last reply
          0
          • B bkelly13

            Windows 7, Visual Studio 2010, C++ How can an application determine the maximum size for a single chunk of data to be sent from a server application to a client application on another computer? This is on a private network, not not accessible outside of the control room. There is a switch between the two computers but that is about it. I presume this can be done a run time. My application sends large amounts of telemetry data to a client for display. The goal is to reduce buffering as much as possible. The app uses overlapped I/O with completion events.

            Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com

            A Offline
            A Offline
            Albert Holguin
            wrote on last edited by
            #5

            MTU size dictates this... To figure out the system MTU size at run-time, in Linux use getsockopt() with IP_MTU. ip(7): IPv4 protocol implementation - Linux man page[^] Windows has a similar call but not sure if the MTU option is readily available. Keep in mind that every device that the packet touches will impose it's own MTU size restrictions on it and you can't necessarily control all of them (depends on setup of course). In another words, even if your device doesn't fracture a packet, another one down the line may choose to do so. There are ways to do "mtu" discovery to find the max size transferrable. Just something to be aware of.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups