Update socketlib.py

Writing the base.