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. Socket returning as readable when it is not.

Socket returning as readable when it is not.

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpquestion
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.
  • E Offline
    E Offline
    esepich
    wrote on last edited by
    #1

    I have used the select(); function in an attempt to program a [Timed out] message into my program. In this case the host I am working with is www.ebay.com. You will notice that if you open a command prompt in windows and ping www.ebay.com that you will get four [timed out] output messages sent to the screen. I would like to do the same thing with my program and have chosen to use the select(); function to accomplish this task. The problem is that select(); returns the socket connected to www.ebay.com as readable. How could this be? If I can't use select(); to discover that I have not gotten a reply, how then will I know that no echo reply has been sent back to me? Thank you, Eric Sepich

    J 1 Reply Last reply
    0
    • E esepich

      I have used the select(); function in an attempt to program a [Timed out] message into my program. In this case the host I am working with is www.ebay.com. You will notice that if you open a command prompt in windows and ping www.ebay.com that you will get four [timed out] output messages sent to the screen. I would like to do the same thing with my program and have chosen to use the select(); function to accomplish this task. The problem is that select(); returns the socket connected to www.ebay.com as readable. How could this be? If I can't use select(); to discover that I have not gotten a reply, how then will I know that no echo reply has been sent back to me? Thank you, Eric Sepich

      J Offline
      J Offline
      Johnny
      wrote on last edited by
      #2

      Remember that a ping is performed at a lower level (ICMP) than a normal socket using select (TCP). Probably the reason you get no response by pinging www.ebay.com, is that the server is not responding to ping requests, and yet does respond to TCP requests (it would have to in order to serve HTTP!). Hence your select returns that it has connected.

      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