|
Symbian platform (C++)
SDK native APIs, runtime and tooling
|
One connected IPv4 TCP stream backed by Symbian RSocket. More...
#include <cpp/symbian/api/include/symbian/api/connectivity/tcp_client.h>
Public Member Functions | |
| TcpClient (TcpClient &&other) noexcept | |
| TcpClient & | operator= (TcpClient &&other) noexcept |
| TcpClient (const TcpClient &)=delete | |
| TcpClient & | operator= (const TcpClient &)=delete |
| ~TcpClient () | |
| void | Close () |
| Close on the owner thread; repeated calls are harmless. | |
| absl::Status | SetNoDelay (bool enabled=true) |
| Disable Nagle buffering for interactive message transports. | |
| absl::Status | Send (std::span< const std::uint8_t > bytes, absl::Time deadline=absl::InfiniteFuture()) |
| Complete one native send request of at most 32 KiB by a deadline. | |
| absl::StatusOr< std::size_t > | Receive (std::span< std::uint8_t > bytes, absl::Time deadline=absl::InfiniteFuture()) |
| Receive at least one byte into a buffer of at most 32 KiB. | |
Static Public Member Functions | |
| static absl::StatusOr< TcpClient > | ConnectIpv4 (std::array< std::uint8_t, 4 > address, std::uint16_t port, absl::Time deadline=absl::InfiniteFuture()) |
| Connect to four IPv4 octets by an absolute deadline. | |
| static absl::StatusOr< TcpClient > | ConnectHost (std::string_view hostname, std::uint16_t port, absl::Time deadline=absl::InfiniteFuture()) |
| Resolve an ASCII DNS hostname and connect by one deadline. | |
Friends | |
| class | TcpListener |
| class | ActiveTcpListener |
One connected IPv4 TCP stream backed by Symbian RSocket.
Connect, Send and Receive wait for native request completion. Use this worker-facing helper on one thread, including destruction. A finite deadline cancels and drains a pending native request on expiry. The native socket session and handle close when the object is destroyed.
|
noexcept |
|
delete |
| symbian::api::connectivity::TcpClient::~TcpClient | ( | ) |
| void symbian::api::connectivity::TcpClient::Close | ( | ) |
Close on the owner thread; repeated calls are harmless.
|
static |
Resolve an ASCII DNS hostname and connect by one deadline.
Uses the native resolver, returning its first IPv4 result. International names must be supplied as ASCII A-labels. Resolution cancels and drains on expiry, like socket I/O. No resolver cache or scheduler is created.
|
static |
Connect to four IPv4 octets by an absolute deadline.
InfiniteFuture waits until the native request completes. A finite deadline cancels and drains the connect request on expiry.
| absl::StatusOr< std::size_t > symbian::api::connectivity::TcpClient::Receive | ( | std::span< std::uint8_t > | bytes, |
| absl::Time | deadline = absl::InfiniteFuture() |
||
| ) |
Receive at least one byte into a buffer of at most 32 KiB.
The returned count is the number of bytes written. An empty span returns zero. Native EOF and disconnect results are returned as statuses. On expiry the pending read is cancelled and drained; the stream can be reused.
| absl::Status symbian::api::connectivity::TcpClient::Send | ( | std::span< const std::uint8_t > | bytes, |
| absl::Time | deadline = absl::InfiniteFuture() |
||
| ) |
Complete one native send request of at most 32 KiB by a deadline.
The caller keeps bytes alive until this method returns. An empty span succeeds without a socket request. Expiry cancels and drains the pending send. Delivery may already have occurred; use an application acknowledgement when it matters. This synchronous API does not report partial progress.
| absl::Status symbian::api::connectivity::TcpClient::SetNoDelay | ( | bool | enabled = true | ) |
Disable Nagle buffering for interactive message transports.
|
friend |
|
friend |