資源簡介
linux c實現基于tcp多進程并發文件傳輸,傳輸目錄為執行文件當前目錄
代碼片段和文件信息
#include?//
#include?//
#include?//
#include?//
#include?
#include?//
#include?
#include?
#include?
#include?
#include?//
#include?//
#include?
int?main(int?argc?char?**argv)
{
????int?sockfd?len;
????struct?sockaddr_in?dest;
????char?recvbuf[1024];
????char?sendbuf[1024];
????int?fd;
char?*filename?=?argv[3];
????if?(argc?!=?4)?
????{
printf(“?error?formatit?must?be:\n\t\t%s?IP?port\n“argv[0]);
exit(EXIT_FAILURE);
????}
????if?((sockfd?=?socket(AF_INET?SOCK_STREAM?0))?0)?
????{
perror(“Socket“);
exit(errno);
????}
????printf(“socket?created\n“);
????bzero(&dest?sizeof(dest));
????dest.sin_family?=?AF_INET;
????dest.sin_p
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1661??2013-07-08?15:30??cli.c
?????文件????????2995??2013-07-08?15:16??ser.c
- 上一篇:SSH源碼 圖書管理系統
- 下一篇:銀行員工培訓管理系統
評論
共有 條評論