Function hydroflow::util::bind_tcp_bytes
source ยท pub async fn bind_tcp_bytes(
addr: SocketAddr,
) -> (Sender<(Bytes, SocketAddr)>, Receiver<Result<(BytesMut, SocketAddr), Error>>, SocketAddr)
Expand description
Returns a newline-delimited bytes Sender
, Receiver
, and SocketAddr
bound to the given address.
The input addr
may have a port of 0
, the returned SocketAddr
will be the address of the newly bound endpoint.
The inbound connections can be used in full duplex mode. When a (T, SocketAddr)
pair is fed to the Sender
returned by this function, the SocketAddr
will be looked up against the currently existing connections.
If a match is found then the data will be sent on that connection. If no match is found then the data is silently dropped.