C# Server Socket program
The C# Socket Programming has two sections.
1. C# Server Socket Program
Server Socket ProgramThe Server Socket Program here is a C# Console based Application . This program act as a Server and listening to clients request . Here we assign a Port No. 8888 for the Server Socket , it is an instance of the C# Class TcpListener , and call its start() method.
The next step is to create an infinite loop for monitoring the request from Client's side . When the Server Socket accept a request from the Client side, it reads the data from NetworkStream and also it write the response to NetworkStream .
From the following C# program you can understand how to create a Socket Server in C# . Create a new C# Console Application Project and put the following source code into the project.
Full Source C#How to run this program ?
The C# Socket Programming has two sections.
1. C# Server Socket Program
When you finish coding and build the Server and Client program , First you have to start C# Server Socket Program from DOS prompt , then you will get a message " Server Started " in your DOS screen, where the server program is running .
Next step is to start C# Client Socket Program in the same computer or other computers on the same network . When you start the client program , it will establish a connection to the Server and get a message in client screen " Client Started " , at the same time you can see a message in the Server screen " Accept connection from client " .
Now your C# Server Socket Program and C# Client Socket Program is get connected and communicated . If you want to communicate the Server and Client again , click the button in the client program , then you can see new messages in the Server and Client programs displayed.
Full Source C#- How to send email from C#
- How to send email with attachment from C#
- How to send html email from C#
- How to send cdo email from C#
- How to find hostname of a computer
- How to find IP Adress of a computer
- How to read URL Content from webserver
- How to C# Socket programming
- C# Client Socket program
- C# Multi threaded socket programming
- C# Multi threaded Server Socket programming
- C# Multi threaded Client Socket programming
- How to C# Chat server programming
- How to C# Chat Server
- How to C# Chat Client
- How to web browser in C#
- No connection could be made because the target machine actively refused it
- System.Net.Sockets.SocketException (0x80004005)
- C# HttpClient - HTTP requests with HttpClient in C#
- C# HttpClient status code