rewrote server greenlet to check for server stopping while waiting for tcp connection