0% found this document useful (0 votes)
36 views16 pages

Network Programming

The document describes a network programming project involving a client-server model for chat applications. It includes use case diagrams, class diagrams for the client and server structures, activity diagrams, and descriptions of server and client functions.

Uploaded by

Hoàng Bùi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views16 pages

Network Programming

The document describes a network programming project involving a client-server model for chat applications. It includes use case diagrams, class diagrams for the client and server structures, activity diagrams, and descriptions of server and client functions.

Uploaded by

Hoàng Bùi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Network

Programming
Group 18
Bùi Tú Hoàng – 20176761
Nguyễn Trung Nghĩa – 20176835
Use case Diagram

6/2021 Network Programming 2


Client Structure

• address: client address


• room: room structure
• sockfd: socket file description
• uid: client ID
• name: client name

6/2021 Network Programming 3


Room Structure

• host: room’s host name


• roomid: room ID

6/2021 Network Programming 4


Activity Diagram

6/2021 Network Programming 5


Flow Diagram

6/2021 Network Programming 6


Server
Functions

6/2021 Network Programming 7


void *handle_client(void *arg)
Create thread for each client connection and process
sent and received message.

6/2021 Network Programming 8


void add_client(client_t *cl) void remove_client(int uid)

6/2021 Network Programming 9


Client
Functions
• connectServer: connects client to server and holds client alive
• recv_room_list: receives room list from server
• username_handler: sets client name
• option_handler: creates new room
• room_handler: joins room by id
• send_msg: sends message to server
• recv_msg: receives message from server
• catch_ctrl_c_and_exit: checks exit signal and exits client

6/2021 Network Programming 10


void send_msg()

void recv_msg ()

6/2021 Network Programming 11


Graphical User Interface

PyQt
Python bindings for cross-platform GUI
toolkit Qt
• Using signal to send and display message
• Thread to hold client alive and listen message from
server

6/2021 Network Programming 12


Application Interface
Connect to server Name and Room handler

6/2021 Network Programming 13


Chat tab

6/2021 Network Programming 14


Task Assigment
• Bùi Tú Hoàng
• Client, User Interface
• Creating presentation slides

• Nguyễn Trung Nghĩa


• Server
• Writing report

6/2021 Network Programming 15


Thank you Do you have any question?

6/2021 Network Programming 16

You might also like