Struct internet2::transport::unencrypted::Stream
source · pub struct Stream(_);
Expand description
Wrapper type around TCP stream for implementing FTCP-specific traits
Trait Implementations§
source§impl DuplexConnection for Stream
impl DuplexConnection for Stream
source§impl RecvFrame for Stream
impl RecvFrame for Stream
source§fn recv_frame(&mut self) -> Result<Vec<u8>, Error>
fn recv_frame(&mut self) -> Result<Vec<u8>, Error>
Receive a single frame of data structured as a byte string. The frame
contains LNP framing prefix, which is used by upstream session-level
protocols. Read more
source§fn recv_raw(&mut self, len: usize) -> Result<Vec<u8>, Error>
fn recv_raw(&mut self, len: usize) -> Result<Vec<u8>, Error>
Try to receive
len
number of bytes and pack them as a frame.
The actual amount of bytes received may differ for some protocols,
like ZMQ, so the function should be used with caution! Read moresource§fn recv_routed(&mut self) -> Result<RoutedFrame, Error>
fn recv_routed(&mut self) -> Result<RoutedFrame, Error>
Receive frame like with
RecvFrame::recv_frame
, but only originating
from the specified remote address. Read moresource§impl SendFrame for Stream
impl SendFrame for Stream
source§fn send_frame(&mut self, data: &[u8]) -> Result<usize, Error>
fn send_frame(&mut self, data: &[u8]) -> Result<usize, Error>
Sends a single frame of data structured as a byte string. The frame must
already contain LNP framing prefix with size data. The function must
check that the provided data frame length is below the limit defined
with
MAX_FRAME_SIZE
constant if a tcp connection is used. Read moresource§fn send_raw(&mut self, data: &[u8]) -> Result<usize, Error>
fn send_raw(&mut self, data: &[u8]) -> Result<usize, Error>
Sends a single frame of data structured as a byte string. The frame must
already contain LNP framing prefix with size data. Read more
source§fn send_routed(
&mut self,
_source: &[u8],
_route: &[u8],
_address: &[u8],
_data: &[u8]
) -> Result<usize, Error>
fn send_routed(
&mut self,
_source: &[u8],
_route: &[u8],
_address: &[u8],
_data: &[u8]
) -> Result<usize, Error>
Sends a single frame of data structured as a byte string to a specific
receiver with
remote_id
. Function works like RecvFrame::recv_frame
and is used for the underlying protocols supporting multipeer
connectivity. The frame must already contain LNP framing prefix with
size data. Read more