Implement assignSocket functions
Properly implement the server check