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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Socket messages

Socket messages

Scheduled Pinned Locked Moved C / C++ / MFC
designsysadminquestion
5 Posts 3 Posters 1 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.
  • E Offline
    E Offline
    erkanina
    wrote on last edited by
    #1

    Hi, I have a dialog based application. It uses connection oriented Windows Sockets. My application is not responding or responding very latter to the user interface messages like mouse and keybard input; When the network data traffic producing high amount of Socket messages like FD_READ. How can I solve this. Is there a short method to filter and process mouse and keyboard messages before processing socket's FD_READ message. Thanks and best regards.

    A L 2 Replies Last reply
    0
    • E erkanina

      Hi, I have a dialog based application. It uses connection oriented Windows Sockets. My application is not responding or responding very latter to the user interface messages like mouse and keybard input; When the network data traffic producing high amount of Socket messages like FD_READ. How can I solve this. Is there a short method to filter and process mouse and keyboard messages before processing socket's FD_READ message. Thanks and best regards.

      A Offline
      A Offline
      Antony M Kancidrowski
      wrote on last edited by
      #2

      Put your socket read code etal into a worker thread. This will free up the main thread to do all the standard message handling for keyboard, mouse etc. Ant. I'm hard, yet soft.
      I'm coloured, yet clear.
      I'm fuity and sweet.
      I'm jelly, what am I?
      - David Willaims (Little Britain)

      E 1 Reply Last reply
      0
      • E erkanina

        Hi, I have a dialog based application. It uses connection oriented Windows Sockets. My application is not responding or responding very latter to the user interface messages like mouse and keybard input; When the network data traffic producing high amount of Socket messages like FD_READ. How can I solve this. Is there a short method to filter and process mouse and keyboard messages before processing socket's FD_READ message. Thanks and best regards.

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

        It sounds like you might have the application waiting in socket read. Maybe putting the read in a worker thread would sort your problem ? I've done this before and it worked fine. Elaine :rose: The tigress is here :-D

        1 Reply Last reply
        0
        • A Antony M Kancidrowski

          Put your socket read code etal into a worker thread. This will free up the main thread to do all the standard message handling for keyboard, mouse etc. Ant. I'm hard, yet soft.
          I'm coloured, yet clear.
          I'm fuity and sweet.
          I'm jelly, what am I?
          - David Willaims (Little Britain)

          E Offline
          E Offline
          erkanina
          wrote on last edited by
          #4

          Thank a lot for your response Mr Trollslayer and Mr Antony M Kancidrowski, My socket routines are non blocking and fully event driven. I am using WinSock APIs. The socket reader routine is event driven and do not blocks application when data is not received. When FD_READ message receives it reads available data's and then returns. The worker thread is good solution but I have to handle up to 1024 server connections. More than one server connection and data receiving process may require high amount of system resources with this solution. The problem is that; I want to capture mouse and keyboard messages before FD_READ message handling. Thanks anmd best regards Erkan Ermis

          E 1 Reply Last reply
          0
          • E erkanina

            Thank a lot for your response Mr Trollslayer and Mr Antony M Kancidrowski, My socket routines are non blocking and fully event driven. I am using WinSock APIs. The socket reader routine is event driven and do not blocks application when data is not received. When FD_READ message receives it reads available data's and then returns. The worker thread is good solution but I have to handle up to 1024 server connections. More than one server connection and data receiving process may require high amount of system resources with this solution. The problem is that; I want to capture mouse and keyboard messages before FD_READ message handling. Thanks anmd best regards Erkan Ermis

            E Offline
            E Offline
            erkanina
            wrote on last edited by
            #5

            Or in another word, Can I replace my mouse and keyboard messages on the top of the application message que. I heard that it is possible but I can not see a sample code up to now. Thanks and best regards. Erkan Ermis

            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