added sample server with socket function