Supports function as objects. Supports proper socket closing.