Giter VIP home page Giter VIP logo

Comments (4)

computski avatar computski commented on June 15, 2024 1

Update. This is strange. If I use Invoke as you suggest from the TCP session, it will call my data processing routine and this routine then tries to update the UI but the textbox does not update. If I pause it in the debugger, the line updating the textbox is running on the main thread (the UI thread) as expected yet it does not update the display.

If instead I go back to bubbling the tcpSession data up as an event to my data processor, the dataprocesser runs on a non UI thread as expected, but when it calls a delegate I wrote to update the UI, this DOES work and the display updates as expected. This is my solution, so I will stop there. Thanks for putting me onto delegates.

from netcoreserver.

alandemaria avatar alandemaria commented on June 15, 2024

Whenever you create a TcpSession when receiving a connection, pass a reference to the form. Instead of bubbling up the incoming data via event, override the OnReceived method of the TcpSession and perform the UI update logic via a delegate passed to the Invoke method of the form control.

from netcoreserver.

computski avatar computski commented on June 15, 2024

Thanks. I implemented Invoke on the form, and data from the TCPSession is being passed to a subroutine inside the form class successfully. No thread errors. The routine processes the data and writes to a textbox on the form UI, except that textbox does not display the new data. using the Update method or application.doEvents does not force the textbox to update either. debug.print proves the data is arriving and even that the .text property of the textbox is holding the new data, but it won't redisplay. Am stumped.

from netcoreserver.

computski avatar computski commented on June 15, 2024

closing this out, thx

from netcoreserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.