Back in the day, VB6 had the Winsock.ocx control, which provided dead simple access to UDP and TCP communications. It exposed events which fired when data was received, and the interface was extremely simple and straightforward to use. You could build a TCP client/server app or UDP communication app in minutes.
Fast forward to VB.NET and all we seem to have are the System.Net.Sockets
libraries like UdpClient
, which are extremely convoluted to use. They either require the use of Task
s or Thread
s, or the Receive()
call blocks until data arrives, freezing the entire UI until a message is received.
To me this seems like a backward step, but maybe I'm missing something.
Is there an alternative library/plugin which provides:
- Events which fire when data is received etc.
- No need to deal with threads or tasks
- Does not block and can be used in a WinForms app
- Simple way to send/receive arbitrary data via UDP or TCP connections?