|
@@ -57,14 +57,16 @@ struct CloseMessage {
|
|
|
};
|
|
|
#pragma pack(pop)
|
|
|
|
|
|
-DataChannel::DataChannel(unsigned int stream, string label, string protocol,
|
|
|
- Reliability reliability)
|
|
|
- : mStream(stream), mLabel(std::move(label)), mProtocol(std::move(protocol)),
|
|
|
+DataChannel::DataChannel(shared_ptr<PeerConnection> pc, unsigned int stream, string label,
|
|
|
+ string protocol, Reliability reliability)
|
|
|
+ : mPeerConnection(std::move(pc)), mStream(stream), mLabel(std::move(label)),
|
|
|
+ mProtocol(std::move(protocol)),
|
|
|
mReliability(std::make_shared<Reliability>(std::move(reliability))),
|
|
|
mRecvQueue(RECV_QUEUE_SIZE) {}
|
|
|
|
|
|
-DataChannel::DataChannel(unsigned int stream, shared_ptr<SctpTransport> sctpTransport)
|
|
|
- : mStream(stream), mSctpTransport(sctpTransport),
|
|
|
+DataChannel::DataChannel(shared_ptr<PeerConnection> pc, shared_ptr<SctpTransport> transport,
|
|
|
+ unsigned int stream)
|
|
|
+ : mPeerConnection(std::move(pc)), mSctpTransport(transport), mStream(stream),
|
|
|
mReliability(std::make_shared<Reliability>()) {}
|
|
|
|
|
|
DataChannel::~DataChannel() { close(); }
|