pub struct TcpClusterTransport { /* private fields */ }Expand description
TCP-based cluster transport. One listener per node accepts inbound
connections; outbound connections are opened on demand and reused
per peer address. Frames are length-prefixed (4-byte big-endian)
bincode-encoded ClusterFrames.
Implementations§
Source§impl TcpClusterTransport
impl TcpClusterTransport
Sourcepub fn new(self_addr: Address, bind: SocketAddr) -> Self
pub fn new(self_addr: Address, bind: SocketAddr) -> Self
Build a new TCP transport. The system name is taken from
self_addr.system; the bind socket is given separately because
Address doesn’t carry a port until listen resolves it.
pub fn with_advertised( self_addr: Address, bind: SocketAddr, advertised_host: Option<String>, ) -> Self
Sourcepub async fn listen(&self) -> Result<Address>
pub async fn listen(&self) -> Result<Address>
Listen on the configured bind address. The returned Address
reflects the actually-bound socket (so callers that pass
0.0.0.0:0 learn the auto-allocated port). The protocol
scheme is forced to akka.tcp since the resolved address
represents a real TCP listener.
pub fn local_address(&self) -> Option<SocketAddr>
Sourcepub fn take_inbound(&self) -> UnboundedReceiver<ClusterFrame>
pub fn take_inbound(&self) -> UnboundedReceiver<ClusterFrame>
Hand the inbound receiver out (call once). Subsequent calls return an empty channel.
Sourcepub fn start(
&self,
gossip_inbox: UnboundedSender<GossipPdu>,
sink: Arc<dyn RemoteMessageSink>,
)
pub fn start( &self, gossip_inbox: UnboundedSender<GossipPdu>, sink: Arc<dyn RemoteMessageSink>, )
Spawn the inbound demultiplex task. Mirrors
InProcessClusterTransport::start.
Sourcepub fn send_remote(
&self,
target: &Address,
target_path: String,
manifest: String,
payload: Vec<u8>,
sender_path: Option<String>,
)
pub fn send_remote( &self, target: &Address, target_path: String, manifest: String, payload: Vec<u8>, sender_path: Option<String>, )
Send a RemoteTell frame to target. Best-effort.