MS has beautiful examples of Server/Client Socket, they work really well:
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/asynchronous-server-socket-example
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/asynchronous-client-socket-example
How could I adapt it to work with WinForms using a TextBox
to display data?
How do I call methods StartListening();
and StartClient();
using a button from UI?
When data is received, how do I actively invoke an EventHandler
, which would process the message based on a switch structure, and then perform different tasks based on the data received?
Thanks
What I have tried:
I've tried to implement the console code in a WinForms projects without much success.