Invoke

This is a partial fix for issue #2. I have only fixed the problem in `socket`. The problem still exists in `file_server` but the same solution could be applied there.