A simple Chat program written in Java with NIO package
The protocol specified in the assignment.pdf (in Portuguese) is vaguely similar to IRC.
- Compile it with
- Run the server with a listening port as argument
java ChatServer 31337
- Run the client with the server IP address and the listening port
java ChatClient 127.0.0.1 31337
To test the sending of a fragmented message divided in various packages, use
<CTRL-D>, as in
/ni<CTRL-D>ck Chu<CTRL-D>ck No<CTRL-D>rris<ENTER>
To test the sending of various messages in a single package, you can try it with
netcat localhost 31337 < test_package_input.txt
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program, in the file "LICENSE". If not, see http://www.gnu.org/licenses/.