On Tue, Jun 13, 2017 at 06:37:27PM +0200, Darshit Shah wrote: > > - http_server_port still hardcoded. > This is important. The port should be a random number. Usually, passing 0 in > the port number makes the kernel choose an open one for you. > > Having a randomised port is important to ensure that multiple runs don't > step on each other.
I still don't know how to accomplish this. Maybe, it just my understanding that when I pass 0 in MHD port number, the result is still 0. Another approach, when I look into the old code, it generate port number by calling wget_tcp_get_local_port(). But, I need to call wget_tcp_init() and wget_tcp_listen() respectively in order to get proper result. Conclusion, do I need to use existing wget_tcp_get_local_port() to get the port, or maybe there is a function in MHD to do that? Thank you. Regards, Didik Setiawan