file_server

所属分类:云原生工具
开发工具:C
文件大小:10KB
下载次数:0
上传日期:2023-04-28 22:23:39
上 传 者sh-1993
说明:  C中的服务器、镜像和客户端,通过与套接字通信工作。服务器和镜像提供负载平衡
(A Server, Mirror and Client in C which works by communicating with Sockets. The server and mirror provide load balancing)

文件列表:
client.c (8648, 2023-04-29)
mirror.c (12203, 2023-04-29)
server.c (14344, 2023-04-29)

# file_server A Server, Mirror and Client in C which works by communicating with Sockets and has capabilities to run on different machines. The server and mirror provide load balancing so that the first 4 clients are served by Server, the next 4 clients by the Mirror and clients after that are served alternatively by the Server and Mirror respectively. Update the mirror's Ip and portno at the line no. 20,21 and 336 in Server.c Setup: Compile all the files: 1. gcc -o server.c server -pthread 2. gcc -o mirror.c mirror 3. gcc -o client.c client Usage: First run the mirror with a port on a machine: ./mirror portno Then run the server with a portno on another machine: ./server portno The last run the clients on client machines and provide the Server's Ip address and port number. ./client server_ip server_portno

近期下载者

相关文件


收藏者