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. Using sockets against a human parsed interface

Using sockets against a human parsed interface

Scheduled Pinned Locked Moved C / C++ / MFC
hardwarehelplounge
2 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.
  • V Offline
    V Offline
    voodoopriestess
    wrote on last edited by
    #1

    Heya, I've writing an application to interface with a telnet client to provide a nice graphical front-end to a remote piece of hardware. Unfortunately, the telnet interface is designed to be parsed by a human and so has no nice features like terminators and has random lag. Delays as long as 250ms are routine and although this poses no problems for a human reading the response; plays havok with an automated front end. I was wondering if people out there had come across similar problems and what solutions they've tried and the success they've had. Currently, my sockets code runs with an 80% chance of getting all the data from the device. The big issue is that it is sooo slow as I deliberately wait for 250ms just in case. Any ideas... Iain ---- "I would be careful in separating your weirdness, a good quirky quantum weirdness, from the disturbed weirdness of people who take pleasure from PVC sheep with fruit repositories."

    P 1 Reply Last reply
    0
    • V voodoopriestess

      Heya, I've writing an application to interface with a telnet client to provide a nice graphical front-end to a remote piece of hardware. Unfortunately, the telnet interface is designed to be parsed by a human and so has no nice features like terminators and has random lag. Delays as long as 250ms are routine and although this poses no problems for a human reading the response; plays havok with an automated front end. I was wondering if people out there had come across similar problems and what solutions they've tried and the success they've had. Currently, my sockets code runs with an 80% chance of getting all the data from the device. The big issue is that it is sooo slow as I deliberately wait for 250ms just in case. Any ideas... Iain ---- "I would be careful in separating your weirdness, a good quirky quantum weirdness, from the disturbed weirdness of people who take pleasure from PVC sheep with fruit repositories."

      P Offline
      P Offline
      Phil Speller
      wrote on last edited by
      #2

      I might be on completely the wrong track here but, it's sounds like you are using select() with a 250ms timeout and are using synchronous style comms (i.e. select() will block). Why not take a look at a non-blocking mode of operation and use WSAAsyncSelect()/WSAEventSelect() or use the callback mechanism offered by WSARecv. This will move your code to an asynchronous style of operation and mean that you should pick up all packets, no matter when they arrive. Hope this helps, Phil

      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