Project Idea & Objective:
The idea behind the project is to create an application that can talk to each other(chat) in the same computer or different computers on the same network.
Concept: Socket: A socket is defined as an endpoint for communication. A pair of processes communicating over a network employs a pair of sockets—one for each process. A socket is identified by an IP address concatenated with a port number. In general, sockets use a client–server architecture. The server waits for incoming client requests by listening to a specified port. Once a request is received, the server accepts a connection from the client socket to complete the connection.
Walkthrough
- The server blocks waiting for a client to connect to it
- A client connects
- The server and the client exchange information until they're done
- The client and the server both close their connection
Address:
- Port Address and IP address is given to both client and server.
- When the socket connection is established both client and server listens each others port.
How to execute this file:
You can execute either using Eclipse IDE or put all the files in a zip file and open a two cmd prompts for server and client, then execute the server program first. Next, execute the client program then Input some message from each window and check whether it is recieved on both the ends.
NOTE While executing the program, If you find any "binding error" then check in your computer whether the particular port given in the program is already being used by some other running process. If you find one stop the process and reexcute the program again.
Programming Language: Java
Software Requirements: Eclipse IDE Editor or a Notepad
System Requirement: You can execute the program in any OS environment such as Windows, MAC or Linux etc., I have programmed the application using Windows operating system.