Function hydroflow::util::udp_framed

source ·
pub fn udp_framed<Codec, Item>(
    socket: UdpSocket,
    codec: Codec
) -> (UdpFramedSink<Codec, Item>, UdpFramedStream<Codec>, SocketAddr)
where Codec: Encoder<Item> + Decoder,
Expand description

Helper creates a UDP Stream and Sink from the given socket, using the given Codec to handle delineation between inputs/outputs. Also returns the bound UdpSocket, which will be different than the input UdpSocket if the input socket was set to port 0.