Add socket utility methods