Changed "iface" to "ip_addr" to make IP address more explcit.
Replace use of `gmtime()` with `gmtime_r()`.
Correctly bind socket to local interface.