Refactoring socket methods.
Merge branch 'master' of github.com:fhinkel/InteractiveShell