Networking Forums

Networking Forums > Computer Networking > Linux Networking > Address and port are already in use

Reply
Thread Tools Display Modes

Address and port are already in use

 
 
Igor
Guest
Posts: n/a

 
      08-30-2006, 06:15 PM
Please help!

I have daemon listening on port 80. After working for few days if I
stop it I cannot start it again - it cannot open socket for listening
with error something like "Address and port are already in use". I
checked that process is not running and netstat/lsof are saying that
there noone is listening on port 80.
The only was for me to start service again is restarting network
service (service network restart) - after this operation my daemon
starts as it suposed to.

Thanks in advance.

 
Reply With Quote
 
 
 
 
Davide Bianchi
Guest
Posts: n/a

 
      08-30-2006, 06:39 PM
On 2006-08-30, Igor <(E-Mail Removed)> wrote:
> I have daemon listening on port 80. After working for few days if I
> stop it I cannot start it again - it cannot open socket for listening


Evidently is not stopped completely, maybe you need to kill him.

Davide

--
Linux: Because rebooting is for adding new hardware
 
Reply With Quote
 
Igor
Guest
Posts: n/a

 
      08-30-2006, 07:10 PM

Davide Bianchi wrote:
> On 2006-08-30, Igor <(E-Mail Removed)> wrote:
> > I have daemon listening on port 80. After working for few days if I
> > stop it I cannot start it again - it cannot open socket for listening

>
> Evidently is not stopped completely, maybe you need to kill him.
>

There are no process in the system with that name, and with netstat I
see no sockets with that port.

Thanks

 
Reply With Quote
 
Davide Bianchi
Guest
Posts: n/a

 
      08-30-2006, 07:25 PM
On 2006-08-30, Igor <(E-Mail Removed)> wrote:
> There are no process in the system with that name, and with netstat I
> see no sockets with that port.


Well, from what you said it seems a problem in the socket being in use,
try to ask the developer of that software if they know of such bug.

Davide

--
....the Windows NT machines at work work much like the reannual wine of the
Discworld. They reboot as a reaction to the crash they will have later
that day. --Art
 
Reply With Quote
 
Igor
Guest
Posts: n/a

 
      08-30-2006, 08:01 PM
I am developer
App finished gracefully, it closes all sockets. And then on start it
just cannot open port.

Thanks


Davide Bianchi wrote:
> On 2006-08-30, Igor <(E-Mail Removed)> wrote:
> > There are no process in the system with that name, and with netstat I
> > see no sockets with that port.

>
> Well, from what you said it seems a problem in the socket being in use,
> try to ask the developer of that software if they know of such bug.
>
> Davide
>
> --
> ...the Windows NT machines at work work much like the reannual wine of the
> Discworld. They reboot as a reaction to the crash they will have later
> that day. --Art


 
Reply With Quote
 
hondza
Guest
Posts: n/a

 
      08-30-2006, 08:47 PM
On 2006-08-30, Igor <(E-Mail Removed)> wrote:
> I am developer
> App finished gracefully, it closes all sockets. And then on start it
> just cannot open port.


You may try

#v+
int x, err;
err = setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x));
#v-

before bind(). Netcat also sets SO_REUSEPORT when it's available.

> Thanks


Hope it helps.

--
hondza aka "kinderzrout" | GPG key: http://www.hondza.adslink.cz/key.asc
Fingerprint: 31E7 EF56 7280 5C89 75E9 FF9D 010E 175F 7823 CF38
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Bind to port 22 on 0.0.0.0 failed: Address already in use Pascal Hambourg Linux Networking 2 03-01-2010 12:00 PM
simple q on IP address and port number dew Linux Networking 3 03-24-2007 12:16 PM
Multiple UDP Binds to the same ip:port address? subaruwrx88011@gmail.com Linux Networking 0 05-16-2006 04:04 PM
Port Address Translation Sherwin Windows Networking 8 01-06-2004 06:27 AM
ProFTPd port 21: Address already in use kolya Linux Networking 1 10-17-2003 09:09 PM



1 2 3 4 5 6 7 8 9 10 11