Client server program using System.Net.Sockets libraries.
This sample demonstrates:
This is exactly what happened to me a year ago, now I am able to share a sample code to all fellow .NET developers out there.
Honestly, it is not that easy.
The biggest deal is you need to implement your own multi-thread model when developing solution using system.net.sockets. And there is no fixed format.
However, the benefit is that you can easily switch to serial com using exactly the same architecture.
Happy coding and let's make the world a better place to live; to become less stressful, more hope and love.
Download the sample code in VB.NET(Visual Studio 2008 SP1)
Check out the VB6 equivalent.
This sample demonstrates:
- Duplex communication mode
- Usage of system.net.sockets.socket over usage of system.net.sockets.TcpClient and TCPListener.
- Custom connect timeout implementation.
- Transfer text and image (of any sizes)
This is exactly what happened to me a year ago, now I am able to share a sample code to all fellow .NET developers out there.
Honestly, it is not that easy.
The biggest deal is you need to implement your own multi-thread model when developing solution using system.net.sockets. And there is no fixed format.
However, the benefit is that you can easily switch to serial com using exactly the same architecture.
Happy coding and let's make the world a better place to live; to become less stressful, more hope and love.
Download the sample code in VB.NET(Visual Studio 2008 SP1)
Check out the VB6 equivalent.
Comments