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. fast return of data to the server

fast return of data to the server

Scheduled Pinned Locked Moved C / C++ / MFC
sysadmindata-structuresjsonhelptutorial
3 Posts 2 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.
  • D Offline
    D Offline
    Diprom
    wrote on last edited by
    #1

    с++ compiler

    Hello colleagues.
    There is one task, and I think how to implement it more correctly and faster.
    In general terms, transfer many different binary data to 1 server.
    There is an iocp asynchronous server that receives data from clients.
    Then this processed data is converted and added to the queue packets.
    There can be many such packets per second (300 - 1000).
    Asynchronous processing parses this queue, and the data in each packet in the queue
    should be given over TCP / IP to another server. I do not want to create an additional stream for the client per packet from queue parsing. Is there any quick fix?

    packets of
    queue :

    1 ->to 127.0.0.1 3615
    2 ->to 127.0.0.1 3615
    3 ->to 127.0.0.1 3615
    4 ->to 127.0.0.1 3615
    5 ->to 127.0.0.1 3615
    6 ->to 127.0.0.1 3615
    7 ->to 127.0.0.1 3615
    8 ->to 127.0.0.1 3615
    9 ->to 127.0.0.1 3615
    ..
    ..

    Thank you.

    D 1 Reply Last reply
    0
    • D Diprom

      с++ compiler

      Hello colleagues.
      There is one task, and I think how to implement it more correctly and faster.
      In general terms, transfer many different binary data to 1 server.
      There is an iocp asynchronous server that receives data from clients.
      Then this processed data is converted and added to the queue packets.
      There can be many such packets per second (300 - 1000).
      Asynchronous processing parses this queue, and the data in each packet in the queue
      should be given over TCP / IP to another server. I do not want to create an additional stream for the client per packet from queue parsing. Is there any quick fix?

      packets of
      queue :

      1 ->to 127.0.0.1 3615
      2 ->to 127.0.0.1 3615
      3 ->to 127.0.0.1 3615
      4 ->to 127.0.0.1 3615
      5 ->to 127.0.0.1 3615
      6 ->to 127.0.0.1 3615
      7 ->to 127.0.0.1 3615
      8 ->to 127.0.0.1 3615
      9 ->to 127.0.0.1 3615
      ..
      ..

      Thank you.

      D Offline
      D Offline
      Diprom
      wrote on last edited by
      #2

      I wanted to clarify.
      When the packet went to the server, we expect a response from it.
      Once the correct answer is received, the packet is removed from the queue.
      The faster the queue is empty, the faster the other server will receive the packets.

      S 1 Reply Last reply
      0
      • D Diprom

        I wanted to clarify.
        When the packet went to the server, we expect a response from it.
        Once the correct answer is received, the packet is removed from the queue.
        The faster the queue is empty, the faster the other server will receive the packets.

        S Offline
        S Offline
        Stefan_Lang
        wrote on last edited by
        #3

        I'm confused: 1. TCP/IP already takes care of packet delivery; it makes sure it arrives, and if it doesn't, it gets resent. Why implement another queue on top of that? That just creates more traffic, and you made a point you want to avoid that. 2. You said something about asynchronous processing, but if you implement a queue as you said, it enforces synchronization! So what do you want? Synchronized or not? That said, I have no experience in programming this kind of stuff, I only know the theory. But maybe there's something to the many things people say about theory and practice http://wiki.c2.com/?QuotesOnTheoryVsPractice[^] ;)

        GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

        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