基于Linux的socket多客户多文件传输系统.docx

基于Linux的socket多客户多文件传输系统.docx

  1. 1、本文档共19页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
基于Linux的socket多客户多文件传输系统

摘要线程(thread)技术早在60年代就被提出,但真正应用线程到操作系统中去。使用多线程的理由之一是和进程相比,它是一种非常节俭的多任务操作方式。在Linux系统下,启动一个新的进程必须分配独立的地址空间,建立众多的数据表来维护它的代码段、堆栈段和数据段。而运行于一个进程中的多个线程,它们之间使用相同的地址空间,共享大部分数据,启动一个线程所花费的空间远远小于进程所花费的空间,而且,线程间彼此切换所需的时间也远远小于进程间所需要的时间。?使用多线程的理由之二是线程间方便的通信机制。对不同进程来说,它们具有独立的数据空间,要进行数据的传递只能通过通信的方式进行,这种方式费时且很不方便。由于同一进程下的线程之间共享数据空间,所以一个线程的数据可以直接为其它线程所用,这样快且方便。?在计算机中,凡是提供服务的一方我们称为服务端(Server),而接受服务的另一方我们称作客户端(Client)。不过客户端及伺服端的关系不见得一定建立在两台分开的机器上,提供服务的伺服端及接受服务的客户端也有可能都在同一台机器上,这样在同一台机器上就同时扮演伺服端及客户端。?线程间方便的通信机制可以使得在我们在服务端和客户端方便的进行通信传输与各种操作,可以通过运用多线程机制方便实现上传、下载文件;增加、删除用户;以及在服务端进行文件的管理。?本文介绍了基于TCP/IP协议的客户端和服务器通信的基础上,在Linux的环境对套接口进行编程,实现了双客户间的通信.关键字:双客户通信;Linux;TCP/IP协议;Socket套接口;I/O复用AbstractThread (thread) technology as early as in the 1960s have been proposed, but the real application threads to go to the operating system. One of the reasons is the use of multiple threads and processes compared to, it is a very frugal multitasking operating mode. In the Linux system, start a new process must be assigned a separate address space, the establishment of a large number of data tables to maintain its code segment, stack and data segments. While running on a process of multiple threads between them using the same address space, shared most of the data, the space it takes to start a thread process takes far less than the space, and, switching between threads each required time is far less than the time required for inter-process.Reason two is the use of multiple threads to facilitate inter-thread communication mechanisms. Different processes, they have separate data space, the data to be transmitted only by way of communicating, consuming and inconvenient in this way. Because the shared data space between threads of the same process under a thread so that data can be used directly by other threads, so quick and easy.In the computer, all serving one we call the server (Server), and served other we call the client (Client). But the relationship between the client and the servo end not necessarily bu

文档评论(0)

2017ll + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档