// Simulates UDP semantics over TCP. Send and Recv packet sizes // are preserved, and drops packets silently on Send, rather than // buffer them in user space. class AsyncTCPSocketBase : public AsyncPacketSocket { public:
AsyncTCPSocketBase(absl_nonnull std::unique_ptr<Socket> socket,
size_t max_packet_size);
~AsyncTCPSocketBase() override;
using AsyncPacketSocket::Send; using AsyncPacketSocket::SendTo;
// Pure virtual methods to send and recv data.
int Send(constvoid* pv,
size_t cb, const AsyncSocketPacketOptions& options) override = 0; // Must return the number of bytes processed. virtual size_t ProcessInput(std::span<const uint8_t> data) = 0;
State GetState() const override;
int GetOption(Socket::Option opt, int* value) override;
int SetOption(Socket::Option opt, int value) override;
int GetError() const override; void SetError(int error) override;
protected:
int FlushOutBuffer(); // Add data to `outbuf_`. void AppendToOutBuffer(constvoid* pv, size_t cb);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.