UDP port in use

Discussion in 'Linux Networking' started by nanoip, Apr 8, 2008.

  1. nanoip

    nanoip Guest


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

    My software crashed and did not free UDP port. I think that kernel
    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
    to "free the UDP port"? So, that I do not need to reboot PC.

    Help appreciated...ip
    nanoip, Apr 8, 2008
    1. Advertisements

  2. nanoip

    Bill Marcum Guest

    Are you sure the process is really killed? Try lsof or "netstat -unlp"
    Bill Marcum, Apr 8, 2008
    1. Advertisements

  3. nanoip

    Dan N Guest

    Set the socket option, something like:

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

    Dan N, Apr 9, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.