summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/ScreenSharing/RTPSessionImpl.cpp')
-rw-r--r--Swiften/ScreenSharing/RTPSessionImpl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Swiften/ScreenSharing/RTPSessionImpl.cpp b/Swiften/ScreenSharing/RTPSessionImpl.cpp
index 62b05d5..94641ff 100644
--- a/Swiften/ScreenSharing/RTPSessionImpl.cpp
+++ b/Swiften/ScreenSharing/RTPSessionImpl.cpp
@@ -23,6 +23,10 @@
namespace Swift {
+Sender::Sender(boost::shared_ptr<UDPSocket> udpSocket)
+ : udpSocket(udpSocket) {
+}
+
bool Sender::SendRTP(const void *data, size_t len) {
send(data, len);
return true;
@@ -38,7 +42,7 @@ bool Sender::ComesFromThisSender (const jrtplib::RTPAddress* address) {
}
void Sender::send(const void* data, size_t len) {
- unsigned char *uint8Data = (unsigned char*)data;
+ uint8_t* uint8Data = (uint8_t*)data;
udpSocket->send(SafeByteArray(uint8Data, uint8Data + len));
}
@@ -55,6 +59,7 @@ RTPSessionImpl::RTPSessionImpl(boost::shared_ptr<UDPSocket> udpSocket, const RTP
packetInjecter = static_cast<jrtplib::RTPExternalTransmissionInfo*>(session.GetTransmissionInfo())->GetPacketInjector();
udpSocket->onDataRead.connect(boost::bind(&RTPSessionImpl::handleDataRead, this, _1));
+ udpSocket->listen();
}
RTPSessionImpl::~RTPSessionImpl()
@@ -97,7 +102,7 @@ void RTPSessionImpl::injectData(const SafeByteArray& data)
void RTPSessionImpl::stop(int maxWaitMs)
{
session.BYEDestroy(jrtplib::RTPTime(0, maxWaitMs * 1000), "", 0);
- // TODO: shutdown socket
+ udpSocket->close();
}
void RTPSessionImpl::checkError(int rtperr) const