views:

20

answers:

1

I am working in Silverlight 4 and implementing a Polling Duplex service with an asynchronous pattern used to update the clients.


    // interface for messages back to client
    [OperationContract(IsOneWay = true, AsyncPattern=true)]
    IAsyncResult BeginSendMessage(byte[] MessageData, AsyncCallback callback, object State);

    void EndSendMessage(IAsyncResult result);

I make the call back to the client using a RequestState object I defined to keep track of which connected client I sent to.


    AsyncCallback callback = new AsyncCallback(this.MessageSent);
    RequestState state = new RequestState { ConnectionNo = connectionno};
    client.BeginSendMessage(MessageData, callback, state);

I don't see any way to check for an error using the IAsyncResult parameter that is given back in the callback.

So my question is, how can I tell if the message fails to be sent?

A: 
Mike