added socket testing code