VB.Net-Informations.com
   Home      .Net Framework      VB.NET      C#                                                                      About


  VB.NET Socket Programming

A Socket is an End-Point of To and From (Bidirectional) communication link between two programs (Server Program and Client Program ) running on the network . We need two programs for running a socket program. A Server Socket Program ( Server ) and a Client Socket Program ( Client ) .

Server Program: A Server Socket Program running on a computer has a socket that bound to a Port Number on that computer and listening to the client's requests.

Client Program: Client Socket Program have to know the IP Address ( Hostname ) of the computer that the Server Socket Program resides and the Port Number assign for listening for client's request .

vb.net_server_client_socket.JPG

Once the communication is established , the Server and Client can read or write their own sockets.

There are two types of communication protocol use for Socket Programming TCP/IP ( Transmission Control Protocol/Internet protocol ) Communication and UDP/IP ( User Datagram Protocol/Internet protocol ) Communication .

In the following section we are going to communicate a Server Socket Program and Client Socket Program through VB.NET using TCP/IP Communication.

vb.net_server_client_socket_program.JPG

In the above picture shows the communication interfaces .

Server Socket Program:

Here Server Socket Program is done through a Console based VB.NET application . Here the Server listening for the client's request , and when the server get a request from the Client , Server sends the response to Client . Click the following link to see in detail of a Server Socket Program .

Client Socket Program:

The Client Socket Program is a windows based application . When the client start its get connect the server and send requests , and also receive the response from Server . Click the following link to see in detail of Client Socket Program.

How to run this program ?

The Socket Programming has two sections.

1. Server Socket Program

2. Client Socket Program

When you finish coding the program , First you have to start Server Socket Program , then you will get the DOS screen with a message Server Started .

Next step is to start Client Socket Program . Then you will get message in client screen Client Started , at the same time you check with server screen a message Accept connection from client .

Now your Server Socket Program and Client Socket Program get connected . If you want to test the communication , you click the button ( Click here to send data to Server ) in client window , then you can see changes in Server and Client screen messages .

        
        
C# Tutorial




VB.NET Communications Related Contents
*     How to send email from VB.NET
*     VB.NET Send email using CDOSYS
*     How to find IP Address of Host
*     How to read a URL Content
*     VB.NET Server Socket Program
*     VB.NET Client Socket Program
*     VB.NET MultiThreaded Socket Programming
*     VB.NET MultiThreaded Server Socket Programming
*     VB.NET MultiThreaded Client Socket Programming
*     VB.NET Chat Server Program
*     VB.NET Chat Server
*     VB.NET Chat Client


   Home      VB.NET      C#
VB.Net Related Topics
*     Microsoft .Net Framework Tutorials
*     VB.NET Language Basics Tutorials
*     VB.NET Program Flow Control Tutorials
*     VB.NET Collections Tutorials
*     VB.NET String Tutorials
*     VB.NET Files Tutorials
*     VB.NET Excel 2007 Tutorials
*     VB.NET Crystal Reports Tutorials
*     VB.NET Communications Tutorial
*     VB.NET ADO.NET Tutorial
*     ADO.NET Data Providers help and Tutorial
*     VB.NET ADO.NET Dataset Tutorial
*     ADO.NET DataAdapter and Dataset
*     VB.NET ADO.NET DataView Tutorial
*     VB.NET Remoting Tutorial
*     VB.NET XML Tutorial
*     VB.NET DataGridView Tutorial
   Home      VB.NET      C#
More Source Code :   
Mail to :  feedback@net-informations.com
  |  Home   |  VB.NET   |  C#   |  SiteMap   |  Terms of Use   |  About   |
net-informations.com (C) 2010
All Rights Reserved. All other trademarks are property of their respective owners.