Refactor out SwarmSocket from SwarmNetwork.