improved proactor code (server-side)