[英]Send a file from a client to another in a C chat
I am creating a chat in C (Should work on Ubuntu 16.04) based on the IRC protocol. 我正在基于IRC协议在C中创建聊天记录(应该在Ubuntu 16.04上工作)。 I already create the client.c and the server.c.
我已经创建了client.c和server.c。 The chat is working ok and a client can send a message to the server and the server re-send the message to one or all clients.
聊天正常,客户端可以向服务器发送消息,然后服务器将消息重新发送给一个或所有客户端。 The problem is that I dont know how send a file from a client to another client.
问题是我不知道如何从一个客户端向另一个客户端发送文件。
It should be something like the client 1 send part of the file to the server and the server re-send it to the client 2 and so on. 客户端1会将文件的一部分发送到服务器,服务器将其重新发送给客户端2,依此类推。 The problem is that I dont know how to do it because the server must continue attending the clients while it is sending and receiving the file.
问题是我不知道该怎么做,因为服务器在发送和接收文件时必须继续参加客户端。 Thank you
谢谢
在服务器主循环中选择是我所需要的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.