Index: talk/media/sctp/sctpdataengine.h |
diff --git a/talk/media/sctp/sctpdataengine.h b/talk/media/sctp/sctpdataengine.h |
index 86bfa37a48c10dca4c3f5b0cad9a330d27aea10e..d72a1003f405d927bb8d043b80fb996e1347416a 100644 |
--- a/talk/media/sctp/sctpdataengine.h |
+++ b/talk/media/sctp/sctpdataengine.h |
@@ -29,6 +29,7 @@ |
#define TALK_MEDIA_SCTP_SCTPDATAENGINE_H_ |
#include <errno.h> |
+#include <map> |
#include <string> |
#include <vector> |
@@ -190,6 +191,13 @@ class SctpDataMediaChannel : public DataMediaChannel, |
const std::string& debug_name() const { return debug_name_; } |
private: |
+ // Maps sockets back to their SctpDataMediaChannels. For usrsctp |
+ // send-threshold callbacks, we only get the socket* on invocation, but |
+ // need to find the SctpDataMediaChannels. We can get that through the |
+ // library, but would cost us an allocation/free each time the callback is |
+ // invoked. |
+ typedef std::map<struct socket*, SctpDataMediaChannel*> SocketChannelMap; |
+ static SocketChannelMap sock_channel_map_; |
pthatcher1
2015/08/05 21:42:55
Instead of being a static member of the SctpDataMe
lally1
2015/08/18 20:38:56
That makes a lot of sense, but the SctpDataMediaCh
pthatcher1
2015/08/18 21:51:52
We could add SctpDataMediaChannel::SignalDestroyed
|
sockaddr_conn GetSctpSockAddr(int port); |
// Creates the socket and connects. Sets sending_ to true. |
@@ -222,6 +230,8 @@ class SctpDataMediaChannel : public DataMediaChannel, |
void OnStreamResetEvent(const struct sctp_stream_reset_event* evt); |
+ static int SendThresholdCallback(struct socket* sock, uint32_t sb_free); |
+ |
// Responsible for marshalling incoming data to the channels listeners, and |
// outgoing data to the network interface. |
rtc::Thread* worker_thread_; |