added assertions to the socket implementations