Re: How to find out if a TCP port is in use?
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: Julian <email@hidden>
- Date: Fri, 17 Mar 2006 14:02:04 -0300
When bind() fail, you can check the errno to know what happend, if
EADDRINUSE == errno, the port is in use.
Try "man bind" in a shell for more info.
Regards, Julian
On 3/17/06, Andrei Tchijov <email@hidden> wrote:
> 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
>
--
A QuBoy can't clone himself, but he can teleport his mind anywhere!
Para no ser un recuerdo, hay que ser un reloco.
_______________________________________________
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