Comments (4)
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.
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.
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.
closing this out, thx
from netcoreserver.
Related Issues (20)
- Performance of UDP echo server
- Why the cache is not updated? HOT 7
- Add cache to the parent directory of index.html in InsertPathInternal? HOT 2
- Fix Bug: .NetFramework 4.8 ClientWebSocket Cann't Connect To .Net8 WsSession HOT 1
- Unhandled exception in WebSocket HOT 12
- Serialize and Deserialze HOT 3
- SimpleW : a RestAPI above NetCoreServer [not an issue but a library using NetCoreServer] HOT 1
- SslClient does not work in release mode
- Feature-Request: use BufferManager and SocketAsyncEventArgsPool to optimize memory
- netcoreserver is missing NuGet package README file
- WSS on Blazor WASM .NET 8
- 发送消息过快导致部分消息偶尔无法接受到 HOT 2
- Buffer-size in the 'OnReceived' methods can get too long HOT 3
- latency in reception of the first UDP frames (lazy?)
- Buffer.Reserve Wrong Condition? HOT 1
- TCP OnReceived(buffer, 0, received); HOT 1
- Cannot connect to WssChatServer for example
- TcpServer / TcpClient OptionKeepAlive have no effect HOT 2
- Cannot access a disposed object HOT 3
- Is there anyway to get WsOpcode in OnWsReceived?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netcoreserver.