/* * Copyright 2004 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
// Call this when the PMTU changes. void NotifyMTU(uint16_t mtu);
// Call this based on timeout value returned from GetNextClock. // It's ok to call this too frequently. void NotifyClock(uint32_t now);
// Call this whenever a packet arrives. // Returns true if the packet was processed successfully. bool NotifyPacket(constchar* buffer, size_t len);
// Call this to determine the next time NotifyClock should be called. // Returns false if the socket is ready to be destroyed. bool GetNextClock(uint32_t now, long& timeout);
// Call these to get/set option values to tailor this PseudoTcp // instance's behaviour for the kind of data it will carry. // If an unrecognized option is set or got, an assertion will fire. // // Setting options for OPT_RCVBUF or OPT_SNDBUF after Connect() is called // will result in an assertion. enum Option {
OPT_NODELAY, // Whether to enable Nagle's algorithm (0 == off)
OPT_ACKDELAY, // The Delayed ACK timeout (0 == off).
OPT_RCVBUF, // Set the receive buffer size, in bytes.
OPT_SNDBUF, // Set the send buffer size, in bytes.
}; void GetOption(Option opt, int* value); void SetOption(Option opt, int value);
// Returns current congestion window in bytes.
uint32_t GetCongestionWindow() const;
// Returns amount of data in bytes that has been sent, but haven't // been acknowledged.
uint32_t GetBytesInFlight() const;
// Returns number of bytes that were written in buffer and haven't // been sent.
uint32_t GetBytesBufferedNotSent() const;
// Returns current round-trip time estimate in milliseconds.
uint32_t GetRoundTripTimeEstimateMs() const;
// Creates a packet and submits it to the network. This method can either // send payload or just an ACK packet. // // `seq` is the sequence number of this packet. // `flags` is the flags for sending this packet. // `offset` is the offset to read from `m_sbuf`. // `len` is the number of bytes to read from `m_sbuf` as payload. If this // value is 0 then this is an ACK packet, otherwise this packet has payload.
IPseudoTcpNotify::WriteResult packet(uint32_t seq,
uint8_t flags,
uint32_t offset,
uint32_t len); bool parse(const uint8_t* buffer, uint32_t size);
// the allocated buffer
std::unique_ptr<char[]> buffer_ RTC_GUARDED_BY(mutex_); // size of the allocated buffer
size_t buffer_length_ RTC_GUARDED_BY(mutex_); // amount of readable data in the buffer
size_t data_length_ RTC_GUARDED_BY(mutex_); // offset to the readable data
size_t read_position_ RTC_GUARDED_BY(mutex_); mutable webrtc::Mutex mutex_;
};
// This is used by unit tests to test backward compatibility of // PseudoTcp implementations that don't support window scaling. bool m_support_wnd_scale;
};
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.