Package main is the entry point of the chat application.
The chat application allows peers to discover each other and exchange messages in a peer-to-peer manner.
Usage:
- inbox: show all incoming messages - send $peer_name: send a private message to a peer with $peer_name nickname - exit: terminate the application.
Example:
$ chat Enter your name: YOUR_NAME > Private listener started Peer discovered: IP=192.168.1.11, Name=ANOTHER_NAME > send ANOTHER_NAME Enter message: Hello, peers! > exit Exiting...
Networking:
The chat application uses port 8888 for UDP communication (broadcast) and 1234 for TCP (private messages)
Package main provides the main function and related functions for the chat application.