Re: How can I find out if a port is available on linux
- From: "mike@xxxxxxxxxxxxxxx" <mike@xxxxxxxxxxxxxxx>
- Date: Fri, 06 Jul 2007 22:47:05 -0700
On Jul 5, 12:42 pm, "silverburgh.me...@xxxxxxxxx"
<silverburgh.me...@xxxxxxxxx> wrote:
Hi,
How can I find out if a port is available on linux?
One thing i can do is to open() and then close() a port number.
I wonder if there is a more efficient way?
Thank you.
Run: netstat -atnp|grep LISTEN
It will show you the ports already in use. A quick way to tell if a
tcp port is free is to just 'telnet localhost XXXX' where XXXX is the
port. Connection refused means (usually) nothing is listening there.
.
- References:
- How can I find out if a port is available on linux
- From: silverburgh.meryl@xxxxxxxxx
- How can I find out if a port is available on linux
- Prev by Date: Re: C call equivalent of 'which'?
- Next by Date: Re: Query in adding application in Linux
- Previous by thread: How can I find out if a port is available on linux
- Next by thread: Re: How can I find out if a port is available on linux
- Index(es):
Relevant Pages
|