We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ca128d commit 85c5f91Copy full SHA for 85c5f91
src/asynchronous/server.rs
@@ -171,6 +171,22 @@ impl Server {
171
Ok(())
172
}
173
174
+ pub async fn start_connected(&mut self, conn: Socket) -> std::io::Result<()> {
175
+ let services = self.services.clone();
176
+ let shutdown_waiter = self.shutdown.subscribe();
177
+ let delegate = ServerBuilder {
178
+ services,
179
+ streams: Arc::new(Mutex::new(HashMap::new())),
180
+ shutdown_waiter,
181
+ };
182
+ let conn = Connection::new(conn, delegate);
183
+ conn.run()
184
+ .await
185
+ .inspect_err(|e| {
186
+ trace!("connection run error. {}", e);
187
+ })
188
+ }
189
+
190
pub async fn shutdown(&mut self) -> Result<()> {
191
self.stop_listen().await;
192
self.disconnect().await;
0 commit comments