fix a potential memory leak issue if display initialisation fails, implement display port selection properly for IPv6, implemented interface binding for sockets