Reintroduced the flat loop. This is more secure and can handle
disconnects.