Fix TcpListener re-init.

This commit is contained in:
levlam 2020-11-10 02:02:36 +03:00
parent 7febd4f9af
commit 1fa87babb3

View File

@ -40,6 +40,9 @@ void TcpListener::tear_down() {
void TcpListener::loop() { void TcpListener::loop() {
if (server_fd_.empty()) { if (server_fd_.empty()) {
start_up(); start_up();
if (server_fd_.empty()) {
return;
}
} }
sync_with_poll(server_fd_); sync_with_poll(server_fd_);
while (can_read_local(server_fd_)) { while (can_read_local(server_fd_)) {