37 #ifndef RTPTCPTRANSMITTER_H
39 #define RTPTCPTRANSMITTER_H
41 #include "rtpconfig.h"
49 #ifdef RTP_SUPPORT_THREAD
50 #include <jthread/jmutex.h>
75 inline RTPTCPTransmissionParams::RTPTCPTransmissionParams() : RTPTransmissionParams(RTPTransmitter::TCPProto)
89 #define RTPTCPTRANS_HEADERSIZE (20+20+2)
119 int Init(
bool treadsafe);
125 int GetLocalHostName(uint8_t *buffer,
size_t *bufferlength);
126 bool ComesFromThisTransmitter(
const RTPAddress *addr);
127 size_t GetHeaderOverhead() {
return RTPTCPTRANS_HEADERSIZE; }
130 int WaitForIncomingData(
const RTPTime &delay,
bool *dataavailable = 0);
133 int SendRTPData(
const void *data,
size_t len);
134 int SendRTCPData(
const void *data,
size_t len);
137 int DeleteDestination(
const RTPAddress &addr);
138 void ClearDestinations();
140 bool SupportsMulticasting();
141 int JoinMulticastGroup(
const RTPAddress &addr);
142 int LeaveMulticastGroup(
const RTPAddress &addr);
143 void LeaveAllMulticastGroups();
147 int DeleteFromIgnoreList(
const RTPAddress &addr);
148 void ClearIgnoreList();
150 int DeleteFromAcceptList(
const RTPAddress &addr);
151 void ClearAcceptList();
152 int SetMaximumPacketSize(
size_t s);
154 bool NewDataAvailable();
161 virtual void OnSendError(SocketType sock);
163 virtual void OnReceiveError(SocketType sock);
172 uint8_t m_lengthBuffer[2];
173 int m_lengthBufferOffset;
175 int m_dataBufferOffset;
176 uint8_t *m_pDataBuffer;
178 uint8_t *ExtractDataBuffer() { uint8_t *pTmp = m_pDataBuffer; m_pDataBuffer = 0;
return pTmp; }
179 int ProcessAvailableBytes(SocketType sock,
int availLen,
bool &complete,
RTPMemoryManager *pMgr);
182 int SendRTPRTCPData(
const void *data,
size_t len);
184 int PollSocket(SocketType sock, SocketData &sdata);
185 void ClearDestSockets();
186 int ValidateSocket(SocketType s);
190 bool m_waitingForData;
192 std::map<SocketType, SocketData> m_destSockets;
193 std::vector<SocketType> m_tmpSocks;
194 std::vector<int8_t> m_tmpFlags;
195 std::vector<uint8_t> m_localHostname;
196 size_t m_maxPackSize;
198 std::list<RTPRawPacket*> m_rawpacketlist;
203 #ifdef RTP_SUPPORT_THREAD
204 jthread::JMutex m_mainMutex, m_waitMutex;
Helper class for several RTPTransmitter instances, to be able to cancel a call to 'select',...
Definition: rtpabortdescriptors.h:65
This class is an abstract class which is used to specify destinations, multicast groups etc.
Definition: rtpaddress.h:51
A memory manager.
Definition: rtpmemorymanager.h:151
This class is used by the transmission component to store the incoming RTP and RTCP data in.
Definition: rtprawpacket.h:53
Additional information about the TCP transmitter.
Definition: rtptcptransmitter.h:82
Parameters for the TCP transmitter.
Definition: rtptcptransmitter.h:58
RTPAbortDescriptors * GetCreatedAbortDescriptors() const
If non-null, this RTPAbortDescriptors instance will be used internally, which can be useful when crea...
Definition: rtptcptransmitter.h:70
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
A TCP transmission component.
Definition: rtptcptransmitter.h:113
virtual void OnReceiveError(SocketType sock)
By overriding this function you can be notified of an error when receiving from a socket.
Definition: rtptcptransmitter.h:210
virtual void OnSendError(SocketType sock)
By overriding this function you can be notified of an error when sending over a socket.
Definition: rtptcptransmitter.h:209
This class is used to specify wallclock time, delay intervals etc.
Definition: rtptimeutilities.h:86
Base class for additional information about the transmitter.
Definition: rtptransmitter.h:249
Base class for transmission parameters.
Definition: rtptransmitter.h:230
Abstract class from which actual transmission components should be derived.
Definition: rtptransmitter.h:63
ReceiveMode
Three kind of receive modes can be specified.
Definition: rtptransmitter.h:81
@ TCPProto
Specifies the internal TCP transmitter.
Definition: rtptransmitter.h:74