socket method