Creates map of sockets to ids.