From: nanoip on
Hi

I am testing my network software and it crashes some times.

My software crashed and did not free UDP port. I think that kernel
structures
still hold the information for that port. /proc/net/udp has line that
includes some info.
I killed my software/process but still the line is in /proc/net/udp.

And when I start my software again it tells me "UDP port in use".

I can clear the situation by rebooting the PC but is there some other
way
to "free the UDP port"? So, that I do not need to reboot PC.

Help appreciated...ip
From: Bill Marcum on
On 2008-04-08, nanoip(a)hotmail.com <nanoip(a)hotmail.com> wrote:
>
>
> Hi
>
> I am testing my network software and it crashes some times.
>
> My software crashed and did not free UDP port. I think that kernel
> structures
> still hold the information for that port. /proc/net/udp has line that
> includes some info.
> I killed my software/process but still the line is in /proc/net/udp.
>
> And when I start my software again it tells me "UDP port in use".
>
> I can clear the situation by rebooting the PC but is there some other
> way
> to "free the UDP port"? So, that I do not need to reboot PC.
>
> Help appreciated...ip

Are you sure the process is really killed? Try lsof or "netstat -unlp"
From: Dan N on
Set the socket option, something like:

int on = 1;
setsockopt( sockfd, SO_REUSADDR, &on, sizeof(on) );

Dan



On Tue, 08 Apr 2008 05:37:45 -0700, nanoip wrote:

> Hi
>
> I am testing my network software and it crashes some times.
>
> My software crashed and did not free UDP port. I think that kernel
> structures
> still hold the information for that port. /proc/net/udp has line that
> includes some info.
> I killed my software/process but still the line is in /proc/net/udp.
>
> And when I start my software again it tells me "UDP port in use".
>
> I can clear the situation by rebooting the PC but is there some other
> way
> to "free the UDP port"? So, that I do not need to reboot PC.
>
> Help appreciated...ip