Server nio rewrite