Add NetworkAcceptor and NetworkStream interfaces.

These allow mocking of TCPAcceptor and TCPStream respectively.
This commit is contained in:
Peter Johnson
2015-08-02 00:06:27 -07:00
parent 6703968f73
commit 0dcaf56ed1
10 changed files with 93 additions and 33 deletions

View File

@@ -79,6 +79,10 @@ void TCPStream::close() {
m_sd = -1;
}
llvm::StringRef TCPStream::getPeerIP() const { return m_peerIP; }
int TCPStream::getPeerPort() const { return m_peerPort; }
bool TCPStream::WaitForReadEvent(int timeout) {
fd_set sdset;
struct timeval tv;