https://github.com/halilb/irc-client
https://github.com/halilb/irc-client
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/halilb/irc-client
- Owner: halilb
- Created: 2015-12-06T15:54:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-13T22:02:31.000Z (over 10 years ago)
- Last Synced: 2025-03-14T18:19:24.804Z (over 1 year ago)
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# irc-client
This is the client code running a simple messaging protocol.
### Requirements
This client works well with Python 2.7.10. Other versions are not tested.
You also need to have [PyQt](https://wiki.python.org/moin/PyQt) on your computer as it is used to build client's interface.
### Running
You must provide server hostname and port address.
```bash
python main.py
```
### Tests
You have to install [nose](https://nose.readthedocs.org/en/latest/) to run unit tests.
```bash
pip install nose
python main.py
```
### Code Structure
There are 3 main components running on different threads.
#### 1.Interface
Interface is built on top of the PyQt library. It draws a desktop interface for user input, incoming messages and user list.
When user clicks send button, user's message is put in threadQueue without any manipulation. That message is parsed in **Writer** object.
Interface also consumes **screenQueue** form transforming network messages to end user messages according to the chat protocol.
#### 2. Writer
This component communicates with Interface via threadQueue. It parses user messages into protocol messages and send it over TCP.
#### 3. Reader
This component listens server messages and parses them into **IncomingMessage** object. It decides the type of message and related username. After parsing process, it puts IncomingMessage object to screenQueu.
### Server Problems
I experienced 2 problems with the server:
- Server sometimes closes the TCP connection when i try to register a new user name(/nick halil)
- Server does not end messages with new line character(\n). This prevents me from parsing multiple messages within one TCP stream.(TICSAY halil:hello)