How to do simple chat in Linux with TCP-IP ?
- Initiate netcat in a logical Port of Machine A
nc -l 10000
Here 10000 is a logical Port. You can assign 2 ^ 16 Ports. But some are default ports already. This means the service started over network on the port. A normal man nc briefs about it.
- Now Connect using Telnet from the Machine B (or) local machine (Machine A):
- From another Machine like said (Machine B)
#telnet ip 10000 telnet localhost 10000
A simple TCP/IP Session has been implemented in a logical port and can read/write (Means Normal chat :)).