socket initialization method