//An attempt to implement the socket...THIS IMPLEMENTATION IS USED AS CLIENT OF THAT SOCKET..
//IP ADDRESS IS ADDRESS OF PERTICULAR MACHINE IN INTERNET..MEANS IF WE DONT HAVE INTERNET ACCESS..WE WILL NOT HAVE IP ADDRESS OF THAT MACHINE..FOR ANY MACHINE OR SYSTEM...IP ADDRESS MAY BE CHANGED IF IT IS USING PRIVATE NET..BUT IT REMAINS SAME ..IF WE R USING SAME PUBLIC ADDRESS....
//PORT NO. IS VIRTUAL ENTITY..DIFFRENT SERVICES USE DIFFRENT PORT NOS...
//THERE ARE 65536..HIGHEST POSSIBLE PORT NO. LIMIT ...PERTICULAR SERVICE IS USING A PERTICULAR PORT NO..BUT TO COMMUNICATE SOCKETS..WE MAY ENTER THROUGH ANY PORT NO. INTO SYSTEM..
//IP ADDRESS IS LIKE KEY TO IDENTIFY THE SYSTEM...BUT PORT NO. IS LIKE A KEY TO ENTER INTO THE SYSTEM..
//Socket are used as that like a pipe or fifo as we have used before....if we give name to socket by using bind() system call...it will be named socket..that like fifo is named pipe...when we operate program of pipe...no name of pipe will be shown to u in current directory...but when u use fifo ...& operate..that program..u will see name of that fifo..in which data remains untill fifo is not removed ..or data is not read from that fifo
//SO IF WE USE BIND SYSTEM CALL..THEN SOCKET WILL BE NAMED ..IF WE NOT USE BIND SYSTEM CALL...SOCKET WILL NOT BE NAMED...WE WILL MAKE SOCKET NAMED ONLY IN SERVER ..NOT IN CLIENT..I HAVE TOLD U REASON UNDER..
//SOCKETS ARE LITTLE DIFFRENT FROM PIPE,,,THAT IS WHY WE USE THESE SOCKETS IN INTERNET PUPOSES...
//ACTUALLY ONE END OF SOCKET IS FILE DESCRIPTOR AS ..NORMAL PIPE OR FIFO HAVE...BUT THIS SOCKET'S FD CREATED BY USING SOCKET SYSTEM CALL...IS USED BOTH FOR READ OR WRITE,,,,
//THEN WHAT ABOUT ANOTHER END OF SOCKET.?
//OTHER END OF SOCKET REMAINS ATTACHED WITH INTERNET...THROUGH WHICH WE CAN COMMUNICATE TO INTERNET..TO OTHER SYSTEMS USING THERE IP ADDRESSES ..SORY ONLY PUBLIC IP ADDRESSES..BECAUSE PRIVATE IP ADDRESS ARE COTINOUSLY GO ON CHANGING...EVERY TIME WHEN WE CONNECT OUR LAPI..UNLIKE WIRELESS NET(PUBLIC)..
//YOU R THINKING THAT IF FILE DESCRIPTOR FOR BOTH READ OR WRITE ON ONE SIDE..HOW WILL BE COMMUNICATE TO OTHER......YES...WE ARE NOT COMMUNICATING 2 PROCESSES HERE..ALWAYS REMEMBER...WE ARE COMMUNICATING BETWEEN TWO SYSTEMS...USE VIA INTERNET..........
//SO FOR THAT PUPOSE WE WILL CREATE ANOTHER SOCKET ...IN SERVER....WHOSE ALSO ONE END WILL BE FILE DESCRIPTOR & ANOTHER END WILL BE ATTACHED TO NETWORKING////
//THEN HOW WILL WE ATTACH THESE 2 DIFFRENT SOCKETS I.E.ONE IN CLIENT & ONE IN SERVER?....YES...OFFCOURESE....WE HAVE TO GIVE PUBLIC IP ADDRESS & PORT NO. OF SERVER'S SYSTEM..IN CLIENT WHILE MAKING CONNECT SYSTEM CALL IN CLIENT.....IT WILL SEARCH THAT IP ADDRESS IN NETWORK & ENTER INTO THAT SYSTEM...BUT HOW IT ENTERS INTO THAT SYSTEM?..USING WHAT? ...I.E. PORT NO..
//BY IP ADDRESS ..IT SEARCHES THE SYSTEM..& BY HELP OF PORT NO.. IT WILL ENTER INTO THAT SYSTEM..
//THEN HOW WILL WE RECOGNISE SOCKET OF THAT SYSTEM?....