sample code about network program