socket connect method from class example