37 #ifndef RTPTCPTRANSMITTER_H 39 #define RTPTCPTRANSMITTER_H 41 #include "rtpconfig.h" 49 #ifdef RTP_SUPPORT_THREAD 50 #include <jthread/jmutex.h> 51 #endif // RTP_SUPPORT_THREAD 89 #define RTPTCPTRANS_HEADERSIZE (20+20+2) // 20 IP, 20 TCP, 2 for framing (RFC 4571) 118 int Init(
bool treadsafe);
124 int GetLocalHostName(uint8_t *buffer,
size_t *bufferlength);
125 bool ComesFromThisTransmitter(
const RTPAddress *addr);
126 size_t GetHeaderOverhead() {
return RTPTCPTRANS_HEADERSIZE; }
129 int WaitForIncomingData(
const RTPTime &delay,
bool *dataavailable = 0);
132 int SendRTPData(
const void *data,
size_t len);
133 int SendRTCPData(
const void *data,
size_t len);
136 int DeleteDestination(
const RTPAddress &addr);
137 void ClearDestinations();
139 bool SupportsMulticasting();
140 int JoinMulticastGroup(
const RTPAddress &addr);
141 int LeaveMulticastGroup(
const RTPAddress &addr);
142 void LeaveAllMulticastGroups();
146 int DeleteFromIgnoreList(
const RTPAddress &addr);
147 void ClearIgnoreList();
149 int DeleteFromAcceptList(
const RTPAddress &addr);
150 void ClearAcceptList();
151 int SetMaximumPacketSize(
size_t s);
153 bool NewDataAvailable();
160 virtual void OnSendError(SocketType sock);
162 virtual void OnReceiveError(SocketType sock);
171 uint8_t m_lengthBuffer[2];
172 int m_lengthBufferOffset;
174 int m_dataBufferOffset;
175 uint8_t *m_pDataBuffer;
177 uint8_t *ExtractDataBuffer() { uint8_t *pTmp = m_pDataBuffer; m_pDataBuffer = 0;
return pTmp; }
178 int ProcessAvailableBytes(SocketType sock,
int availLen,
bool &complete,
RTPMemoryManager *pMgr);
181 int SendRTPRTCPData(
const void *data,
size_t len);
183 int PollSocket(SocketType sock, SocketData &sdata);
184 void ClearDestSockets();
185 int ValidateSocket(SocketType s);
189 bool m_waitingForData;
191 std::map<SocketType, SocketData> m_destSockets;
192 std::vector<SocketType> m_tmpSocks;
193 std::vector<int8_t> m_tmpFlags;
194 std::vector<uint8_t> m_localHostname;
195 size_t m_maxPackSize;
197 std::list<RTPRawPacket*> m_rawpacketlist;
202 #ifdef RTP_SUPPORT_THREAD 203 jthread::JMutex m_mainMutex, m_waitMutex;
205 #endif // RTP_SUPPORT_THREAD 213 #endif // RTPTCPTRANSMITTER_H virtual void OnReceiveError(SocketType sock)
By overriding this function you can be notified of an error when receiving from a socket...
Definition: rtptcptransmitter.h:209
Specifies the internal TCP transmitter.
Definition: rtptransmitter.h:74
This class is used by the transmission component to store the incoming RTP and RTCP data in...
Definition: rtprawpacket.h:51
Base class for transmission parameters.
Definition: rtptransmitter.h:229
RTPAbortDescriptors * GetCreatedAbortDescriptors() const
If non-null, this RTPAbortDescriptors instance will be used internally, which can be useful when crea...
Definition: rtptcptransmitter.h:70
A TCP transmission component.
Definition: rtptcptransmitter.h:112
This class is an abstract class which is used to specify destinations, multicast groups etc...
Definition: rtpaddress.h:50
void SetCreatedAbortDescriptors(RTPAbortDescriptors *desc)
If non null, the specified abort descriptors will be used to cancel the function that's waiting for p...
Definition: rtptcptransmitter.h:65
Abstract class from which actual transmission components should be derived.
Definition: rtptransmitter.h:62
ReceiveMode
Three kind of receive modes can be specified.
Definition: rtptransmitter.h:80
Parameters for the TCP transmitter.
Definition: rtptcptransmitter.h:57
Definition: rtpfaketransmitter.h:64
Additional information about the TCP transmitter.
Definition: rtptcptransmitter.h:81
This class is used to specify wallclock time, delay intervals etc.
Definition: rtptimeutilities.h:84
A memory manager.
Definition: rtpmemorymanager.h:150
virtual void OnSendError(SocketType sock)
By overriding this function you can be notified of an error when sending over a socket.
Definition: rtptcptransmitter.h:208
Base class for additional information about the transmitter.
Definition: rtptransmitter.h:248
Helper class for several RTPTransmitter instances, to be able to cancel a call to 'select'...
Definition: rtpabortdescriptors.h:64