Spoa example hogs CPU due to a TCP connection in CLOSE_WAIT state

I have a SPOA listening on port 12345 in public cloud. Some bad score IPs or port scanners are making a connection and not sure if they are abruptly closing the connection, but the connection on the SPOA is in CLOSE_WAIT state. SPOA in a loop reading for frames in that fd and over a period of time it hikes the CPU utillization.

spoa.c (read_frame_cb function)

n = read(client->fd, frame->buf + frame->offset,
	 frame->len - frame->offset);
if (n <= 0) {
	if (n < 0) {
		LOG(client->worker, "Frame to read frame : %m");
		goto close;

Ideally the fd should be closed when n is less than or equal to zero. But above its getting closed only when its less than zero. Any reason the fd is alive for n is zero case?

Appreciate your help.