mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-31 03:19:29 +00:00
Added PeerConnection::close() calls to test
This commit is contained in:
@ -50,6 +50,8 @@ void PeerConnection::close() {
|
||||
closeDataChannels();
|
||||
mDataChannels.clear();
|
||||
|
||||
changeState(State::Disconnected);
|
||||
|
||||
// Close Transports
|
||||
if (auto transport = std::atomic_load(&mIceTransport))
|
||||
transport->stop();
|
||||
@ -58,7 +60,6 @@ void PeerConnection::close() {
|
||||
if (auto transport = std::atomic_load(&mSctpTransport))
|
||||
transport->stop();
|
||||
|
||||
// Change state
|
||||
changeState(State::Closed);
|
||||
}
|
||||
|
||||
|
@ -102,8 +102,8 @@ int main(int argc, char **argv) {
|
||||
this_thread::sleep_for(3s);
|
||||
|
||||
if (dc1->isOpen() && dc2->isOpen()) {
|
||||
dc1->close();
|
||||
dc2->close();
|
||||
pc1->close();
|
||||
pc2->close();
|
||||
|
||||
cout << "Success" << endl;
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user