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. SetSockOpt, NO_DELAY and buffering

SetSockOpt, NO_DELAY and buffering

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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.
  • P Offline
    P Offline
    pmarki
    wrote on last edited by
    #1

    Hello. I have a problem sending packets at the right time. My app sends a packet (16-100kbytes) each 10 seconds... but they are paired up and received as 2 packets each 20 seconds. I used setsockopt with no_delay set to 1 and it didn't help. My send buffer is 8192 bytes, I use win98 and winsock 1.1 How can I force winsock to send each packet separately ? Any help would be appreciated...:)

    S 1 Reply Last reply
    0
    • P pmarki

      Hello. I have a problem sending packets at the right time. My app sends a packet (16-100kbytes) each 10 seconds... but they are paired up and received as 2 packets each 20 seconds. I used setsockopt with no_delay set to 1 and it didn't help. My send buffer is 8192 bytes, I use win98 and winsock 1.1 How can I force winsock to send each packet separately ? Any help would be appreciated...:)

      S Offline
      S Offline
      Sameer Maggon
      wrote on last edited by
      #2

      Hi, Actually, it might be that the packets are buffered and sent when buffer is full (normal behavior).. So you have to flush the data from the buffer so that it writes the data. Sameer

      P 1 Reply Last reply
      0
      • S Sameer Maggon

        Hi, Actually, it might be that the packets are buffered and sent when buffer is full (normal behavior).. So you have to flush the data from the buffer so that it writes the data. Sameer

        P Offline
        P Offline
        pmarki
        wrote on last edited by
        #3

        Yes, that's what I am trying to do... Do you know how to flush the data using windows sockets 1.1 ? I think I should switch to winsock version 2.2, there is a SIO_FLUSH command in WSAIoctl()... anyone used that with positive outcome ?

        J 1 Reply Last reply
        0
        • P pmarki

          Yes, that's what I am trying to do... Do you know how to flush the data using windows sockets 1.1 ? I think I should switch to winsock version 2.2, there is a SIO_FLUSH command in WSAIoctl()... anyone used that with positive outcome ?

          J Offline
          J Offline
          Joaquin M Lopez Munoz
          wrote on last edited by
          #4

          Winsock buffers data, but does not wait as long as 10 seconds (by default, it's buffering time, i.e. the time it waits for more data before flushing to the net, is 100 ms.) So I'd say the problem is somewhere else. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

          P 1 Reply Last reply
          0
          • J Joaquin M Lopez Munoz

            Winsock buffers data, but does not wait as long as 10 seconds (by default, it's buffering time, i.e. the time it waits for more data before flushing to the net, is 100 ms.) So I'd say the problem is somewhere else. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

            P Offline
            P Offline
            pmarki
            wrote on last edited by
            #5

            Yeah, you were right... the problem was one else statement which somehow got commented out :omg: and I don't know why... :-D Thanks m8 I was almost ready to switch to w2k ...

            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