none
Event not getting to Client app RRS feed

  • Question

  • Hi I'm trying to pass an event from my wcf tcp service to the client application. The event gets back to the proxy but no further.

    This is probably something simple Here is the code: Thankks!

    publicvoidSetHandler(EventHandlerhandler)

            {

               

    this.HandleMessageReceived = handler;

            }

           

    publicvoidMessageReceived(MessageReceivedDatadata)

            {

                synchContext.Post(

    newSystem.Threading.SendOrPostCallback(OnMessageReceived), data);

            }

           

    privatevoidOnMessageReceived(objectargs)

            {

              

    this.HandleMessageReceived.Invoke(args, null);

            }

    And the client

    public

    voidHandleMessageReceived(objectsender, EventArgse)

            {

               

    if(InvokeRequired)

                {

                    BeginInvoke(

    newHandleMsgReceived(HandleMessageReceived), sender, e);

                }

               

    else


                {

                   

    try


                    {

                       

    varMsgData = (Contracts.MessageReceivedData)sender;

                        txtMessage.AppendText(MsgData.Message.Payload.ToString() +

    " at "+ MsgData.ReceivedTime.ToString("YYYY-MM-dd HH:mm:ss.fff") );

                       

                    }

                   

    catch(Exception)

                    {

                       

                       

    throw;

                    }

                   

                }

            }

    Monday, August 18, 2014 8:30 PM

Answers

All replies