Add socket adapter and tests