**********************************CHAT APPLICATION USING SOCKET PROGRAMMING IN C*******************************************
----------------------------------------------
This is a client - server user-level application using sockets Programming in C.Built on Windows OS using the library functions of Winsock available in C. Both server and client output's both sending & receiving strings on the terminal.The server and client processes can run on same machine
Servers basically do the following :
- Open a socket
- Bind to a address(and port).
- Listen for incoming connections.
- Accept connections
- Read/Send
Clients do the following :
- Create a socket
- Connect to the server
- Read/Write messages
to run it on your systems:
- you have to execute the server file in a command prompt window, using:-
gcc server.c -lws2_32 -o server.exe server.exe
- execute the client file in a new command prompt window, using:-
gcc client.c -lws2_32 -o client.exe client.exe
-
enter the message in the command prompt window related to the client
-
when you want to exit from the infinite loop of "Enter message: ", hit CTRL+C to come out of the execution (usually occurs when no message recieved from the client side)
ON CLIENT SIDE Initialising Winsock... Initialised at Tue Oct 19 14:50:27 2021
Socket created at Tue Oct 19 14:50:27 2021
Connected to server!
Enter message to be sent to server : HELLO WORLD!!
Reply received from Server at: Tue Oct 19 14:50:27 2021
HEYY!
Enter message to be sent to server :