socket sample coding