The Socket Programming has two sections.
1. Server Socket Program
2. Client Socket Program
The Server Socket Program here is a VB.NET Console based Application . This program act as a Server and listening to clients request . We assign Port 8888 for the Server Socket , it is an instance of the VB.NET Class TcpListener , and call its start() method.
Dim serverSocket As New TcpListener(8888)
serverSocket.Start()
Next step we are creating an infinite loop for continuous communication to Client . When Server get the request , it reads the data from NetworkStream and also write the response to NetworkStream .
Create a new VB.NET Console Application Project and put the following source code into project.
VB.NET SourceCode
The next part of this section is Client Socket Program . After create the Client Socket Program , you should first start the Server Socket Program and then start the Client Socket Program . If you need more details about this tutorial please refer to Socket Programming Section .
|