UDP port in use - Networking

This is a discussion on UDP port in use - Networking ; 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. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: UDP port in use

  1. UDP port in use

    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

  2. Re: UDP port in use

    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


+ Reply to Thread