added member functions to socket class