refactored ISocket into IDataSocket. the latter and IListenSocket

now derive from ISocket.
This commit is contained in:
crs
2002-06-17 12:02:26 +00:00
parent e3dcf7febf
commit 57fb87ad10
14 changed files with 78 additions and 59 deletions

View File

@@ -67,23 +67,6 @@ CTCPSocket::bind(
}
}
void
CTCPSocket::connect(
const CNetworkAddress& addr)
{
CThread::testCancel();
if (CNetwork::connect(m_fd, addr.getAddress(),
addr.getAddressLength()) == CNetwork::Error) {
CThread::testCancel();
throw XSocketConnect();
}
// start servicing the socket
m_connected = kReadWrite;
m_thread = new CThread(new TMethodJob<CTCPSocket>(
this, &CTCPSocket::ioThread));
}
void
CTCPSocket::close()
{
@@ -124,6 +107,23 @@ CTCPSocket::close()
}
}
void
CTCPSocket::connect(
const CNetworkAddress& addr)
{
CThread::testCancel();
if (CNetwork::connect(m_fd, addr.getAddress(),
addr.getAddressLength()) == CNetwork::Error) {
CThread::testCancel();
throw XSocketConnect();
}
// start servicing the socket
m_connected = kReadWrite;
m_thread = new CThread(new TMethodJob<CTCPSocket>(
this, &CTCPSocket::ioThread));
}
IInputStream*
CTCPSocket::getInputStream()
{