AMFConnection call which in turn uses httpurlconnection becomes unresponsive while calling getinputstream() for a particular remoting message
Below are the details:
I am trying to communicate with a server using flex messaging library (AMF). The aim is to log-in to the server, create a session and perform some operations. I created an amf connection and use its call method to execute these operations like below:
All of them worked as expected. However, there is one particular operation (initSession) which is causing problem.
As soon as the call statement is executed, the application becomes unresponsive. It doesn't throw an exception, it doesn't go to the next line, it just silently dies after few minutes.
How can I make it return the response (or a part of it)?
Additional Details (things I figured out while debugging):
From the server logs I was able to verify that the request was received and that operation was performed by the server successfully. Ideally, a response should have been received but that is where the problem lies.
I dug a little deeper. AMFConnection internally uses httpurlconnection. When getInputStream() method is called on that httpurlconnection, the application freezes.
The response to that particular remoting message(initSession) is supposed to be comparatively larger than the rest. Maybe the httpurlconnection is having trouble reading large response.
I can't proceed unless I get the response because the response will contain a token which will be used for all the remaining operations. So setting a time out will not help.
The data which is important to me (The Token) will be in the upper part of the response content so I need not read the whole response. First 100-150 characters will suffice.
P.S: I am new here. Let me know if there is anything I need to add/remove in this post. Thanks.