I use Apache Thrift in my applications to exchange data betwean several machines.
I recive data from outspace, create transport, protocol and deserialize recived data into object. Here is my code:
using (var memoryStream = new MemoryStream(data))
{
using (var transport = new TStreamTransport(memoryStream, memoryStream))
{
transport.Open();
using (var protocolo = new TBinaryProtocol(transport))
{
var result = new TCciUserLoginV1.cciUserLoginV1_result();
while (result.Success== null)
{
try
{
result.Read(protocolo);
}
catch { }
}
if (result.Success != null)
{
res = new RequestResult(result.Success);
}
else
{
res = new RequestResult(ResultCodes.LOCAL_ERROR");
}
}
}
}
I know, that I recive binary serialized TCciUserLoginV1.cciUserLoginV1_result, because deserialization of other types throws an exception. But normal deserialization of result.Success property happens only after 10th iterration of while cycle. Whats why I used while. Can anybody tell me whats going on?
Thanks in advance.