first code for socket class