Handle connecting via tcp socket

All tests pass, though no new ones have been written to test the tcp socket handling, mostly because I'm not sure how to handle mocking the TCP socket.