<commit_before># ChatSimple
A simple chat client-server chat tool for homework

## How to build
- Make sure you have install libevent2. On Ubuntu, you can install it using: sudo apt-get install libevent-dev
- Change to the root directory of the project, run: make all


## Start the program
- server Command options: ./chatSimple [port] [-d] [debug]
    1. port: the listened port
    2. -d: run it at background
    3. debug: output some information for debug
- log: If you run it as backgroup, the log will output to current direction, file chatSimple.log  
- client command options: ./client [server-ip] [server-port] [login-name] [debug]
    1. server-ip
    2. server-port
    3. login-name
    4. debug
    
## Protocol
- basic message structure is TLV: 
-TLV(type-length-value) structure
    - type: int, 4 bytes
    - len : int, 4 bytes
    - value: any data, 'len' bytes
    
- user login:
    - type: 0<commit_msg>basic message function ok.<commit_after># ChatSimple
A simple chat client-server chat tool for homework

## How to build
- Make sure you have install libevent2. On Ubuntu, you can install it using: sudo apt-get install libevent-dev
- Change to the root directory of the project, run: make all


## Start the program
- server Command options: ./chatSimple [port] [-d] [debug]
    1. port: the listened port
    2. -d: run it at background
    3. debug: output some information for debug
- log: If you run it as backgroup, the log will output to current direction, file chatSimple.log  
- client command options: ./client [server-ip] [server-port] [login-name] [debug]
    1. server-ip
    2. server-port
    3. login-name
    4. debug
    
## Protocol
- basic message structure is TLV: 
-TLV(type-length-value) structure
    - type: int, 4 bytes
    - len : int, 4 bytes
    - value: any data, 'len' bytes
- user login:
    - type: 0
{'fraction_non_alphanumeric': 0.09428879310344827, 'fraction_numerical': 0.011853448275862068, 'mean_word_length': 2.9012605042016806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5020918', 'n_tokens_mistral': 568, 'n_tokens_neox': 551, 'n_words': 254}