Update socketlib.py

Fixed mistakes in the base.