MCPcopy Create free account
hub / github.com/Barracuda09/SATPI / doSendDataToClient

Method doSendDataToClient

src/output/StreamThreadRtcpTcp.cpp:53–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void StreamThreadRtcpTcp::doSendDataToClient(const int clientID,
54 uint8_t *sr, const std::size_t srlen,
55 uint8_t *sdes, const std::size_t sdeslen,
56 uint8_t *app, const std::size_t applen) {
57 StreamClient &client = _stream.getStreamClient(clientID);
58
59 const std::size_t len = srlen + sdeslen + applen;
60
61 unsigned char header[4];
62 header[0] = 0x24;
63 header[1] = 0x01;
64 header[2] = (len >> 8) & 0xFF;
65 header[3] = (len >> 0) & 0xFF;
66
67 iovec iov[4];
68 iov[0].iov_base = header;
69 iov[0].iov_len = 4;
70 iov[1].iov_base = sr;
71 iov[1].iov_len = srlen;
72 iov[2].iov_base = sdes;
73 iov[2].iov_len = sdeslen;
74 iov[3].iov_base = app;
75 iov[3].iov_len = applen;
76
77 // send the RTCP/TCP packet
78 if (!client.writeHttpData(iov, 4)) {
79 SI_LOG_ERROR("Stream: %d, Error sending %s Stream Data to %s",
80 _stream.getStreamID(), _protocol.c_str(), client.getIPAddressOfStream().c_str());
81 }
82}
83
84}

Callers

nothing calls this directly

Calls 3

writeHttpDataMethod · 0.80
getIPAddressOfStreamMethod · 0.80
getStreamIDMethod · 0.45

Tested by

no test coverage detected