Added more functions to socket class.