added apply method to socket setting