reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
SendData.hxx
Go to the documentation of this file.
1#ifndef RESIP_SendData_HXX
2#define RESIP_SendData_HXX
3
4#include "rutil/Data.hxx"
6
7namespace resip
8{
9
14{
15 public:
17 {
19 // Close the connection. On a WebSocket connection a Close frame is sent first
20 // (RFC 6455 section 5.5.1), with data as its payload: a status code, or nothing.
23 // Send data as a WebSocket Pong frame: the answer to a Ping, whose payload it echoes
25 };
26
29
30 SendData(const Tuple& dest,
31 const Data& pdata,
32 const Data& tid,
33 const Data& scid,
34 bool isEncoded = false):
35 destination(dest),
36 data(pdata),
37 transactionId(tid),
38 sigcompId(scid),
39 isAlreadyEncoded(isEncoded),
41 {
42 }
43
44 // This interface is only used for stun responses
45 SendData(const Tuple& dest, char* buffer, int length) :
46 destination(dest),
47 data(Data::Take, buffer, length),
48 transactionId(Data::Empty),
49 sigcompId(Data::Empty),
50 isAlreadyEncoded(false),
52 {
53 }
54
55 SendData* clone() const
56 {
57 return new SendData(*this);
58 }
59
60 void clear()
61 {
62 data.clear();
63 }
64
65 bool empty() const
66 {
67 return data.empty();
68 }
69
74 // data is already in its wire format (compressed with SigComp, or framed for a
75 // WebSocket) and is sent exactly as it is, including when a write that only
76 // partly went through is retried. Formerly isAlreadyCompressed.
78
79 // .bwc. Used for special commands: ie. to close connections, and enable flow timers
81};
82
83}
84
85#endif
86
87/* ====================================================================
88 * The Vovida Software License, Version 1.0
89 *
90 * Copyright (c) 2026 SIP Spectrum, Inc. https://www.sipspectrum.com
91 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
92 *
93 * Redistribution and use in source and binary forms, with or without
94 * modification, are permitted provided that the following conditions
95 * are met:
96 *
97 * 1. Redistributions of source code must retain the above copyright
98 * notice, this list of conditions and the following disclaimer.
99 *
100 * 2. Redistributions in binary form must reproduce the above copyright
101 * notice, this list of conditions and the following disclaimer in
102 * the documentation and/or other materials provided with the
103 * distribution.
104 *
105 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
106 * and "Vovida Open Communication Application Library (VOCAL)" must
107 * not be used to endorse or promote products derived from this
108 * software without prior written permission. For written
109 * permission, please contact vocal@vovida.org.
110 *
111 * 4. Products derived from this software may not be called "VOCAL", nor
112 * may "VOCAL" appear in their name, without prior written
113 * permission of Vovida Networks, Inc.
114 *
115 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
116 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
117 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
118 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
119 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
120 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
121 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
122 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
123 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
124 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
125 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
126 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
127 * DAMAGE.
128 *
129 * ====================================================================
130 *
131 * This software consists of voluntary contributions made by Vovida
132 * Networks, Inc. and many individuals on behalf of Vovida Networks,
133 * Inc. For more information on Vovida Networks, Inc., please see
134 * <http://www.vovida.org/>.
135 *
136 */
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
bool empty() const noexcept
Checks whether the Data is empty.
Definition Data.hxx:591
Data & clear()
Clears the contents of this Data.
Definition Data.hxx:800
bool isAlreadyEncoded
Definition SendData.hxx:77
SendData(const Tuple &dest, char *buffer, int length)
Definition SendData.hxx:45
SendData(const Tuple &dest, const Data &pdata, const Data &tid, const Data &scid, bool isEncoded=false)
Definition SendData.hxx:30
SendDataCommand command
Definition SendData.hxx:80
bool empty() const
Definition SendData.hxx:65
SendData * clone() const
Definition SendData.hxx:55
Represents a network address.
Definition Tuple.hxx:59
dcm! – add UnusedChecking(_enum) below;