| 134 | } |
| 135 | |
| 136 | void Endpoint::setDevice(QIODevice *device) |
| 137 | { |
| 138 | Q_ASSERT(!m_socket); |
| 139 | Q_ASSERT(device); |
| 140 | m_socket = device; |
| 141 | connect(m_socket.data(), &QIODevice::readyRead, this, &Endpoint::readyRead); |
| 142 | // FIXME Use proper type for m_socket, instead of relying on runtime-connect |
| 143 | // to a slot which doesn't exist in QIODevice |
| 144 | connect(m_socket.data(), SIGNAL(disconnected()), SLOT(connectionClosed())); |
| 145 | if (m_socket->bytesAvailable()) |
| 146 | readyRead(); |
| 147 | } |
| 148 | |
| 149 | Protocol::ObjectAddress Endpoint::endpointAddress() const |
| 150 | { |