Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7035433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:18:13+00:00 2026-05-28T01:18:13+00:00

I have clients thats is connected to a duplex wcf service 24/6 it is

  • 0

I have clients thats is connected to a duplex wcf service 24/6 it is restarted every sunday.
In the client iam using a listview to display some information.
The listview itemssource is binded to a custom ObservableCollection.
The client is calling a keepalive method every minute to the wcf service.

My problem here is the client works fine when there is activity in the client. But when there is no activity and the application just run the keepalive method for about 10-16 hours. And iam trying to add and remove data to the listview it seems that nothing works. But the wcf service logging the method add and remove is working fine. Its like the userinterface isnt updating. When i restart the application everything works fine.

how do i solve this problem ?

My custom ObservableCollection object code :

    public class ObservableOrderResponseQueue : INotifyCollectionChanged, IEnumerable<OrderResponse>
{
    public event NotifyCollectionChangedEventHandler CollectionChanged = (o, e) => { };
    private List<OrderResponse> _list = new List<OrderResponse>();

    /// <summary>
    /// Adds to the list.
    /// </summary>
    /// <param name="orderResponse">OrderResponse.</param>
    public void Add(OrderResponse orderResponse)
    {
        //Only 6 items in list is possible if more then 6 remove the first item.
        if (_list.Count >= 6)
        {
            RemoveAt(0);
        }

        this._list.Add(orderResponse);            

        CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, orderResponse, (_list.Count - 1)));
    }

    /// <summary>
    /// Remove from list.
    /// </summary>
    /// <param name="index">Item index to remove.</param>
    public void RemoveAt(int index)
    {
        OrderResponse order = this._list[index];
        this._list.RemoveAt(index);

        CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, order, index));
    }

    /// <summary>
    /// Remove from list.
    /// </summary>
    /// <param name="orderResponse">Item to be removed.</param>
    public void Remove(OrderResponse orderResponse)
    {
        if (_list.Count == 0) return;

        var item = _list.Where(o => o.OrderDetail.TrayCode == orderResponse.OrderDetail.TrayCode).FirstOrDefault();
        int index = _list.IndexOf(item);

        if (index == -1) return;

        CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, item, index));

        this._list.RemoveAt(index);
    }

    #region IEnumerable<OrderResponse> Members

    public IEnumerator<OrderResponse> GetEnumerator()
    {
        return _list.GetEnumerator();
    }

    #endregion

    #region IEnumerable Members

    IEnumerator IEnumerable.GetEnumerator()
    {
        return _list.GetEnumerator();
    }

    #endregion


}

Here is how i bind the usercontrol to the class.

            //Set up client callbacks events
        App.clientBack.ClientNotified += new ClientNotifiedEventHandler(clientBack_ClientNotified);
        App.clientBack.AddToDisplayEvent += new AddToDisplayEventHandler(clientBack_AddToDisplayEvent);
        App.clientBack.RemoveFromDisplayEvent += new RemoveFromDisplayEventHandler(clientBack_RemoveFromDisplayEvent);
        App.clientBack.UpdateQueueDisplayEvent += new UpdateQueueDisplayEventHandler(clientBack_UpdateQueueDisplayEvent);


        //Show one chair or many.
        if (_settings.IsOneChair)
        {
            userControlOneChair.ItemSource = _queueProductionItems;
        }
        else
        {
            userControlChairs.ItemsSource = _queueProductionItems;
        }

Remove and add methods

        void clientBack_RemoveFromDisplayEvent(object sender, RemoveFromDisplayEventArgs e)
    {
        try
        {
            _logger.Info("Remove from display.");

            userControlChairs.Dispatcher.Invoke((Action)(() =>
            {
                _queueProductionItems.Remove(e.OrderResponse);
            }));
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }

    void clientBack_AddToDisplayEvent(object sender, AddToDisplayEventArgs e)
    {
        try
        {
            _logger.Info("Add to display.");

            userControlChairs.Dispatcher.Invoke((Action)(() =>
            {
                _queueProductionItems.Add(e.OrderResponse);
            }));
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }

Thanks for help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:18:14+00:00Added an answer on May 28, 2026 at 1:18 am

    What i did was implementing a Heartbeat mechanism. And it all worked out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is possible to have WCF Client that connects persistantly using duplex over net.tcp
I have a Linux/c client app that connects to a WCF web service over
I have one WCF service that exposes two operations - IncrementList() and GetList(). Client
I'm trying to figure out why when you have multiple callback clients connected using
Hi have quite a problem with an Service running WCF in duplex-mode. It leaks
I'm using RMI and I have a server object and many clients that connected
I have coded a server in Java that will have several clients connected to
I have a server that connects to multiple clients using TCP/IP connections, using C
I have .Net service that listens on single port over TCP protocol. Clients connect
I have a mobile app webservice client that connects to a WCF webservice(on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.