I have a callback api with oneway = true, netTCPBinding. And service calls callback on client what i observe was that data arrive in out of order fashion!
Service:
[OperationContract(IsOneWay = true)]
SendData(DateTime time, double[] data)
void SendData()
{
while(data = GetNextData() != null)
{
SendData(DateTime.Now, data);
}
}
Client: [CallbackBehavior(UseSynchronizationContext = false)]
public class Data
{
public DateTime time;
public double[] data;
}
ConcurrentQueue<double[]> queue;
SendData(DateTime time, double[] data)
{
queue.Enque(new Data (time, data));
}
I consume queue in another thread, what i observe is "time" which tells me time in service when sendData(..) called is out of order of data in queue! [SendData(..) in service is called in loop and in single thread, which make sure that time is always in increasing..
1) Why i am getting out of order delivery of data where as TCP provides ordered delivery of packet. Is the problem in my code or I need WCF - reliable session?
2) What is the purpose of setting reliable session as enabled with Order as true in case of TCP which already provides in order delivery.
3) Is there any alternative to reliable session order = true?