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. C / C++ / MFC
  4. How to send huge data via sockets in continuous intervals

How to send huge data via sockets in continuous intervals

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminjsontutorial
6 Posts 3 Posters 0 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.
  • M Offline
    M Offline
    manoharbalu
    wrote on last edited by
    #1

    Our MFC Server application send huge real time data of size 900000bytes using CSocket (TCP/IP Sockets) via serialization continuously every 2 second to the MFC Client. But After a few minutes, the application gets slowed down. Is there any specific ways or methods of send/receive huge data continuosly via Csocket. How to send the big data every interval in a better way.

    S B 3 Replies Last reply
    0
    • M manoharbalu

      Our MFC Server application send huge real time data of size 900000bytes using CSocket (TCP/IP Sockets) via serialization continuously every 2 second to the MFC Client. But After a few minutes, the application gets slowed down. Is there any specific ways or methods of send/receive huge data continuosly via Csocket. How to send the big data every interval in a better way.

      S Offline
      S Offline
      Shyam Kodase
      wrote on last edited by
      #2

      Increase Baudrate of CSocket and reduce data chunk size while communication.. big data if reduced to small data chunks with sequence added in the data packet may help in faster data transfer across systems.. look in windows provided CSocket for more info ;)

      M 1 Reply Last reply
      0
      • M manoharbalu

        Our MFC Server application send huge real time data of size 900000bytes using CSocket (TCP/IP Sockets) via serialization continuously every 2 second to the MFC Client. But After a few minutes, the application gets slowed down. Is there any specific ways or methods of send/receive huge data continuosly via Csocket. How to send the big data every interval in a better way.

        S Offline
        S Offline
        Shyam Kodase
        wrote on last edited by
        #3

        reduce time interval to 500ms interval upto 4 subiteration in 1st iteration.. (which in effect will result in 2s interval) and after 4th subiteration append all data at client side. ;)

        1 Reply Last reply
        0
        • S Shyam Kodase

          Increase Baudrate of CSocket and reduce data chunk size while communication.. big data if reduced to small data chunks with sequence added in the data packet may help in faster data transfer across systems.. look in windows provided CSocket for more info ;)

          M Offline
          M Offline
          manoharbalu
          wrote on last edited by
          #4

          Can i get more information in this regard...reducing to small data chunks with sequence added in the data packet. How many data chunks could be done for 900000bytes of data. Please give me the steps or some example and detail.

          S 1 Reply Last reply
          0
          • M manoharbalu

            Our MFC Server application send huge real time data of size 900000bytes using CSocket (TCP/IP Sockets) via serialization continuously every 2 second to the MFC Client. But After a few minutes, the application gets slowed down. Is there any specific ways or methods of send/receive huge data continuosly via Csocket. How to send the big data every interval in a better way.

            B Offline
            B Offline
            Bram van Kampen
            wrote on last edited by
            #5

            Hi, You need your own Protocol, and need to remember that the Internet can only deal with a limited ascii character set. I take it that this is not an issue. The first step is to send your data in packages of, say 4K to 64K in size. A single large lot will Clog up the channel, because of in evitable channel errors. With a large block of Data frequently sent, the socket becomes overloaded, and on fault, requires a resent of the entire package. Break the entire data up in say 4K Blocks The way of doing this, is, by breaking up each data block to be send, into blocks, and sending them preceded with a header field containing a Unique Identifier,to confirm the data, and, a Block Order Number. At the Other End, you have a thread that stitches the data together again,.

            Bram van Kampen

            1 Reply Last reply
            0
            • M manoharbalu

              Can i get more information in this regard...reducing to small data chunks with sequence added in the data packet. How many data chunks could be done for 900000bytes of data. Please give me the steps or some example and detail.

              S Offline
              S Offline
              Shyam Kodase
              wrote on last edited by
              #6

              create a struct data structure similar to: struct myPacket{ int uwSeq;// sequencing starts from 1 upto 879 int maxSeqCount;// when this reaches 879 reaset to 1 char myData[1024];//Small Chunk unsigned int uwcrcData;//CRC of uwSeq,myData }stSmallChunk; send stSmallChunk data packet and validate at other end using CRC recieved seqs. FYI: 1024*879 small chunks =900096 Bytes -Shyam Kodase

              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