Struct dcl_rpc::server::ServerEventsSender
source · pub struct ServerEventsSender(_);Expand description
Structure to send events to the server from outside
Implementations§
source§impl ServerEventsSender
impl ServerEventsSender
sourcepub fn send_attach_transport<T: Transport + Send + Sync + 'static>(
&self,
transport: T
) -> ServerResult<()>
pub fn send_attach_transport<T: Transport + Send + Sync + 'static>( &self, transport: T ) -> ServerResult<()>
Sends a ServerEvents::AttachTransport to the RpcServer
This allows you to notify the server that has to attach a new transport and make it run to listen for new messages
This is equivalent to RpcServer::attach_transport but it can be used to attach a transport to the RpcServer from another spawned thread (or background task)
This allows you to listen on a port in a background task for external connections and attach multiple transports that want to connect to the server