The value of ok is not set at NioTcpServer.migrateTo. Adding an ok = true; statement should fix the issue.
The server is always closed as a result.