This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Diogo Cordeiro 619d47ae66 dump solution 2019-12-25 14:52:27 +00:00
src dump solution 2019-12-25 14:52:27 +00:00
LICENSE dump solution 2019-12-25 14:52:27 +00:00
Makefile dump solution 2019-12-25 14:52:27 +00:00
README.md dump solution 2019-12-25 14:52:27 +00:00
assignment.pdf dump solution 2019-12-25 14:52:27 +00:00
test_package_input.txt dump solution 2019-12-25 14:52:27 +00:00

README.md

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

  1. Compile it with make
  2. Run the server with a listening port as argument
  java ChatServer 31337
  1. 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/.