@urtrivedi - I am assuming that because you are using private IP addreses that
both PCs are on the same LAN
both PCs are behind a router
In that case, the address of the gateway (I'm also assuming the third address in each group is the gateway) should be the address of the router. Many routers reserve 192.168.1.1 for themselves. In that case the addresses should be more like
im trying to make a chat messenger between two pc. you say hi, and the other pc receive it and reply it back to you. but i dont know what connection they have to make a connection. i studied, i googled, but i dont understand enough. i hope someone can clear me out about this. thankyou very much :)
Are you using one cable or going through a switch?
If it's one cable a regular ethernet cable won't work, it has to be a crossover. On the other hand a switch will handle the crossover so 2 ethernet cables will work.
Is your firewall(s) configure to allow the connection?
Also what is assigning your IP addresses? Are they configured properly in the software on each machine?
There may be other things I can't think of right now but this should be a good start.
If you can't ping the other IP address, you'll never get it to work...
Turn off any firewalls on both computers
Assign/Configure their IP addresses (DHCP, Static, Static DHCP, or Automatic Private IP Addressing)
Ping each computer from the other, using the IP's you posted above - on computer #1 (with IPA = 192.168.1.1) your command would be ping 192.168.1.2; on computer #2 the command would be ping 192.168.1.1
If ping doesn't get a reply, then your "network" is not working.