• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OT ping sample code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OT ping sample code


  • Subject: Re: OT ping sample code
  • From: "Andy Cave" <email@hidden>
  • Date: Mon, 12 Jan 2004 21:15:29 -0000

Hi Igor.

I have an implementation of ping that does the OS9 stuff under OS9 (as per
sample from Apples web site), and under OSX 'simulates' ping by attempting
to connect to ports 9 (discard port) and then 21 (ftp port). I further test
the error code I get back, if the connect fails. If a machine refuses
connections on those ports, but does exist, it appears that I get an error
"kOTCanceledErr" back, whereas if the machine doesn't exist, then I get a
different error.

I'm not saying this is 'best practise', but the combination of all of this
seems to work and I've used it for quite a while now. I'm not sure how this
will work across the internet, but then my ping only needs to work on an
intranet (so I don't care).

Hope that helps.

_andy.

----- Original Message -----
From: "Igor garnov" <email@hidden>
To: "Macintosh Network Programming" <email@hidden>
Sent: Monday, January 12, 2004 5:56 PM
Subject: Re: OT ping sample code


> Thank you everyone for quick replies!
>
> What you told me made me think... different :)
> In other words, if it costs me so much trouble to implement the ping so
> that it would be compatible with both Mac OS 9 and X, maybe I can do
> without it?
>
> The thing is, ping is the only way to know if a host is online. But
> maybe you know something else?
>
> If I do not know everything about the host - how could I know exactly
> if it is online or not?
>
> I understand that I could try connecting to some port. But if I fail to
> connect this might just mean that this host just does not listen on
> this port.
>
> Any ideas are greatly appreciated.
>
> Again, thanks very much for your help!
>
> Regards,
>
> Igor
> _______________________________________________
> macnetworkprog mailing list | email@hidden
> Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: OT ping sample code
      • From: Igor garnov <email@hidden>
References: 
 >Re: OT ping sample code (From: Igor garnov <email@hidden>)

  • Prev by Date: Re: OT ping sample code
  • Next by Date: Re: OT ping sample code
  • Previous by thread: Re: OT ping sample code
  • Next by thread: Re: OT ping sample code
  • Index(es):
    • Date
    • Thread