Add checking logic for socketChannel status.