pub struct IrohListener<In: RpcMessage, Out: RpcMessage> { /* private fields */ }
Expand description
A server endpoint using a quinn connection
Implementations§
Source§impl<In: RpcMessage, Out: RpcMessage> IrohListener<In, Out>
impl<In: RpcMessage, Out: RpcMessage> IrohListener<In, Out>
Sourcepub fn new(endpoint: Endpoint) -> Result<Self>
pub fn new(endpoint: Endpoint) -> Result<Self>
Create a new server channel, given a quinn endpoint, with unrestricted access by node id
The server channel will take care of listening on the endpoint and spawning handlers for new connections.
Sourcepub fn new_with_access_control(
endpoint: Endpoint,
access_control: AccessControl,
) -> Result<Self>
pub fn new_with_access_control( endpoint: Endpoint, access_control: AccessControl, ) -> Result<Self>
Create a new server endpoint, with specified access control
The server channel will take care of listening on the endpoint and spawning handlers for new connections.
Sourcepub fn handle_connections(
incoming: Receiver<Connection>,
local_addr: SocketAddr,
) -> Self
pub fn handle_connections( incoming: Receiver<Connection>, local_addr: SocketAddr, ) -> Self
Create a new server channel, given just a source of incoming connections
This is useful if you want to manage the quinn endpoint yourself, use multiple endpoints, or use an endpoint for multiple protocols.
Sourcepub fn handle_substreams(
receiver: Receiver<(SendStream, RecvStream)>,
local_addr: SocketAddr,
) -> Self
pub fn handle_substreams( receiver: Receiver<(SendStream, RecvStream)>, local_addr: SocketAddr, ) -> Self
Create a new server channel, given just a source of incoming substreams
This is useful if you want to manage the quinn endpoint yourself, use multiple endpoints, or use an endpoint for multiple protocols.