private Object readResponse ( Type returnType , InputStream input , String id ) throws Throwable { ReadContext context = ReadContext . getReadContext ( input , mapper ) ; ObjectNode jsonObject = getValidResponse ( id , context ) ; notifyAnswerListener ( jsonObject ) ; handleErrorResponse ( jsonObject ) ; if ( hasResult ( jsonObject ) ) { if ( isReturnTypeInvalid ( returnType ) ) { return null ; } return constructResponseObject ( returnType , jsonObject ) ; } // no return type return null ; }
Reads a JSON - PRC response from the server . This blocks until a response is received . If an id is given responses that do not correspond are disregarded .