• 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: How to find out if a TCP port is in use?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to find out if a TCP port is in use?


  • Subject: Re: How to find out if a TCP port is in use?
  • From: Andrei Tchijov <email@hidden>
  • Date: Fri, 17 Mar 2006 11:43:12 -0500

Try to do bind() on the port. For none-priveleged ports (>1024) the only reason to fail is if some one else already "listening" on this port.

On Mar 17, 2006, at 11:27 AM, Stephan Ruggiero wrote:

Hello list,

In my cocoa app I want to start a process that is listening on a single TCP port in the background.
Is there a way to find out if there is already an other process using this port?


Linux brings a `netstat`command that can list the processes and their ports but the darwin version seems not to have this functionality...

Thank you very much for your help!

Best regards,

Stephan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: How to find out if a TCP port is in use?
      • From: Julian <email@hidden>
References: 
 >How to find out if a TCP port is in use? (From: Stephan Ruggiero <email@hidden>)

  • Prev by Date: Re: How to find out if a TCP port is in use?
  • Next by Date: Re: Launch Services (or whomever) does not let sleeping disks lie...
  • Previous by thread: Re: How to find out if a TCP port is in use?
  • Next by thread: Re: How to find out if a TCP port is in use?
  • Index(es):
    • Date
    • Thread