src | ||
assignment.pdf | ||
LICENSE | ||
Makefile | ||
README.md | ||
test_package_input.txt |
A simple Chat program written in Java with NIO package
This program was written as a solution for an assignment given in DCC-FCUP's Networking and Communication module. The server implements a multiplex model using Java's NIO API.
The protocol specified in the assignment.pdf (in Portuguese) is vaguely similar to IRC.
Usage
- Compile it with
make
- 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
Tests
To test the sending of a fragmented message divided in various packages, use netcat
with <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
Credits
Developed by Diogo Cordeiro and Hugo Sales
License
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/.