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 e8de5c7 commit f44094fCopy full SHA for f44094f
1 file changed
test/mp/test/listen_tests.cpp
@@ -289,6 +289,21 @@ KJ_TEST("ListenConnections accepts multiple connections")
289
KJ_EXPECT(client3->client->add(3, 4) == 7);
290
}
291
292
+KJ_TEST("ListenConnections survives a client that disconnects before being accepted")
293
+{
294
+ ListenSetup server;
295
+
296
+ // Connect and close before the server has a chance to accept() the
297
+ // connection.
298
+ int fd = server.listener.MakeConnectedSocket();
299
+ close(fd);
300
301
+ // The server should still accept and serve later clients.
302
+ auto client = std::make_unique<ClientSetup>(server.listener.MakeConnectedSocket());
303
+ server.WaitForConnectedCount(1);
304
+ KJ_EXPECT(client->client->add(1, 2) == 3);
305
+}
306
307
} // namespace
308
} // namespace test
309
} // namespace mp
0 commit comments