Wraps POSIX-style TCP sockets with the pw::stream::Reader
and pw::stream::Writer
interfaces. It can be used to connect to a TCP server, or to communicate with a client via the pw::stream::ServerSocket
class.
|
| SocketStream (int connection_fd) |
|
SocketStream & | operator= (SocketStream &&other) |
|
| SocketStream (SocketStream &&other) noexcept |
|
| SocketStream (const SocketStream &)=delete |
|
SocketStream & | operator= (const SocketStream &)=delete |
|
Status | Connect (const char *host, uint16_t port) |
|
int | SetSockOpt (int level, int optname, const void *optval, unsigned int optlen) |
|
bool | IsReady () |
|
void | Close () |
|
| operator NonSeekableReader & () |
|
| operator const NonSeekableReader & () const |
|
| operator NonSeekableWriter & () |
|
| operator const NonSeekableWriter & () const |
|
Reader & | as_reader () |
|
const Reader & | as_reader () const |
|
| operator Reader & () |
|
| operator const Reader & () const |
|
Writer & | as_writer () |
|
const Writer & | as_writer () const |
|
| operator Writer & () |
|
| operator const Writer & () const |
|
constexpr bool | readable () const |
|
constexpr bool | writable () const |
|
constexpr bool | seekable () const |
|
constexpr bool | seekable (Whence origin) const |
| True if the stream supports seeking from the specified origin.
|
|
Result< ByteSpan > | Read (ByteSpan dest) |
|
Result< ByteSpan > | Read (void *dest, size_t size_bytes) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
|
Result< ByteSpan > | ReadExact (ByteSpan const buffer) |
|
Status | Write (ConstByteSpan data) |
|
Status | Write (const void *data, size_t size_bytes) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
|
Status | Write (const std::byte b) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
|
Status | Seek (ptrdiff_t offset, Whence origin=kBeginning) |
|
size_t | Tell () |
|
size_t | ConservativeReadLimit () const |
|
size_t | ConservativeWriteLimit () const |
|