private boolean checkLongPollingOrder ( HttpAcceptSession session ) { if ( firstWriter && ! validateSequenceNo && longpoll ( session ) ) { String message = "Out of order long-polling request, must not be first" ; setCloseException ( new IOException ( message ) ) ; HttpStatus status = HttpStatus . CLIENT_BAD_REQUEST ; session . setStatus ( status ) ; session . setWriteHeader ( HEADER_CONTENT_LENGTH , "0" ) ; session . close ( true ) ; return false ; } return true ; }
If the first write request is long - polling then it is out of order