16 "yarp.stream.websocket",
100 currentHead +=
toAdd;
159 unsigned char toreturn[] =
"\0\0\0\0~\0\0\1q";
220 size_t size =
payload.length();
223 frame.allocate(2 + size);
224 }
else if (size <= 65535) {
225 frame.allocate(4 + size);
227 frame.allocate(10 + size);
237 frame.get()[pos++] = size;
238 }
else if (size <= 65535) {
239 frame.get()[pos++] = 126;
240 frame.get()[pos++] = (size >> 8) & 0xFF;
241 frame.get()[pos++] = size & 0xFF;
243 frame.get()[pos++] = 127;
245 for (
int i = 7;
i >= 0;
i--) {
246 frame.get()[pos++] = ((size >> 8 *
i) & 0xFF);
const yarp::os::LogComponent & WEBSOCK_STREAM()
void reset() override
Reset the stream.
const yarp::os::Contact & getLocalAddress() const override
Get the address of the local side of the stream.
void beginPacket() override
Mark the beginning of a logical packet.
~WebSocketStream() override
void endPacket() override
Mark the end of a logical packet (see beginPacket).
void write(const yarp::os::Bytes &bytesToWrite) override
Write a block of bytes to the stream.
void interrupt() override
Interrupt the stream.
void close() override
Terminate the stream.
OutputStream & getOutputStream() override
Get an OutputStream to write to.
const yarp::os::Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
InputStream & getInputStream() override
Get an InputStream to read from.
bool isOk() const override
Check if the stream is ok or in an error state.
A mini-server for performing network communication in the background.
T * read(bool shouldWait=true) override
Read an available object from the port.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
A simple abstraction for a block of bytes.
static LogCallback printCallback()
Get current print callback.
An abstraction for a block of bytes, with optional responsibility for allocating/destroying that bloc...
const Bytes & bytes() const
void allocate(size_t len)
Makes a data block of the specified length that will be deleted if this object is destroyed.
Simple specification of the minimum functions needed from output streams.
A stream which can be asked to perform bidirectional communication.
virtual InputStream & getInputStream()=0
Get an InputStream to read from.
virtual OutputStream & getOutputStream()=0
Get an OutputStream to write to.
#define yCTrace(component,...)
#define YARP_LOG_COMPONENT(name,...)
An interface to the operating system, including Port based communication.
std::int64_t NetInt64
Definition of the NetInt64 type.
std::int32_t NetInt32
Definition of the NetInt32 type.
The main, catch-all namespace for YARP.