|
From: nanoip on 8 Apr 2008 08:37 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 8 Apr 2008 14:46 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 8 Apr 2008 21:16 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
|
Pages: 1 Prev: Regular Expression Next: How to detect that a USB disk has been plugged? |