我写过一个Linux下的使用Socket传输文件的demo放上github地址:https://github.com/XINCGer/LinuxNetworkProgramming/tree/master/udpFileTransfer使用的是UDP协议~