Skip to content

Commit 117e5f8

Browse files
KarstenBjprendes
andcommitted
Update src/asynchronous/server.rs
Co-authored-by: Jorge Prendes <jorge.prendes@gmail.com> Signed-off-by: Karsten Becker <567973+KarstenB@users.noreply.github.com>
1 parent 146ce05 commit 117e5f8

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/asynchronous/server.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,13 @@ impl Server {
171171
Ok(())
172172
}
173173

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();
174+
pub fn accept(&mut self, conn: Socket) -> Connection<impl Builder> {
177175
let delegate = ServerBuilder {
178-
services,
179-
streams: Arc::new(Mutex::new(HashMap::new())),
180-
shutdown_waiter,
176+
services: self.services.clone(),
177+
streams: Arc::default(),
178+
shutdown_waiter: self.shutdown.subscribe(),
181179
};
182-
let conn = Connection::new(conn, delegate);
183-
conn.run().await
180+
Connection::new(conn, delegate)
184181
}
185182

186183
pub async fn shutdown(&mut self) -> Result<()> {

0 commit comments

Comments
 (0)