Re: Free Ports

From: Andreas Kahari (ak+usenet_at_freeshell.org)
Date: 09/30/03

  • Next message: Tzanko Matev: "Named pipes problem"
    Date: Tue, 30 Sep 2003 09:45:42 +0000 (UTC)
    
    

    In article <etPan.3f793fed.37d168e6.6d11@homer>, DINH Viêt Hoà wrote:
    > ctsblast@rediffmail.com wrote :
    >
    >> I am writing a FTP client & for active mode transfers
    >> would like to know how to find a random free port.
    >>
    >> Is there any sys call/API that can return a free port number.
    >> or Something like in Java where you specify port as zero
    >> and it returns a free port, but I need it in C.
    >
    > the same exist in C language. Just specify 0 as your port.

    I hate to be a pedantic ***, but the C language itself
    doesn't have sockets nor ports. It is, in a way, quite a
    boring language. The POSIX C language bindings, on the other
    hand, have ports and sockets. It might not be a very important
    distinction for many, but if you know what's what, then it'll be
    easier to port the code to non-POSIX platforms.

    -- 
    Andreas Kähäri
    

  • Next message: Tzanko Matev: "Named pipes problem"
  • Quantcast