Replaced socket reference with a network interface, preparation for adding more kinds of connections.