Broker address as "host:port".
Whether the connection is established and not closed.
Perform SASL authentication if configured.
Must be called after connect() and before sending any other requests.
Uses SaslHandshake (v1) to negotiate the mechanism, then SaslAuthenticate
to exchange authentication tokens.
When an auth provider is configured it is invoked here rather than at construction, so each connection — including a replacement created after a disconnect — authenticates with freshly resolved credentials.
Close the connection and reject all pending requests.
Send a request and wait for the correlated response.
Automatically assigns a correlation ID, encodes the request header, frames the message, and returns a BinaryReader positioned after the response header (ready for API-specific body decoding).
API key for the request.
API version for the request.
Callback to encode the request body.
Reader positioned at the start of the response body.
A single connection to a Kafka broker.
Handles request/response correlation, protocol framing, and timeout management. Uses the injected SocketFactory for runtime-agnostic TCP/TLS connections.