Server creates two types of communication tunnels:
- Main tunnel to handle users login / register requests
- Private tunnel with each client where the communication between server and client occurs.
IPC codes:
Code | Description | Source | Tunnel |
---|---|---|---|
random generated | User register / login request | Client | Main tunnel |
received from user | User id assignment | Server | Main tunnel |
1 | User send message request | Client | Private tunnel |
2 | Incoming message | Server | Private tunnel |
3 | New topic subscription | Client | Private tunnel |
4 | Block user request | Client | Private tunnel |
5 | Unblock user request | Client | Private tunnel |
gcc server.c -o s.out -Wall -lpthread
gcc client.c -o c.out -Wall -lpthread
- User login / registration
- Server message request handler
- Saving changes to clients.data file
- Server subscription request handler
- Block request handler
- Unblock request handler
- Blocking client on too many login attempts
- User login / registration
- User send message request
- User subscription request
- Block user request
- Unblock user request
- waitForUserInput() function implementation
- Client behaviour on login block
- Improve UI
- Cleaned files
- Added variable logging in server
- Checking whether serverData directory exists. If not, it's being created
- Blocking user on too many failed login attempts
- Cleaned up warnings during compilation
- Added sync message receiver
- Added unblock functionality
- Improved UI
- Used new IPC code "5"
- Improved waiting for user input thanks to ignoring newline character in scanf inputs using %*c
- Fixed checkIfBlocked function
- Implemented user blocking funtion - client side
- Implemented user blocking funtion - server side
- Used new IPC code "4"
- Moved structures to separate header file
- Waiting for user input is kinda working. But only for main thread. The trick for other threads is to tell user to type 0 to conitnue
- !BUGFIX! Messages are not being trimmed no more (fix from 26.01.2021)
- !BUG! Messages are being trimmed after last space. Client-side error caused by scanf splittin message on white spaces. Need to think of a solution to that
- Subscription requests and handling are probably fully working at this point. Need to test more in the future